adplus-dvertising

Welcome to the Control Flow Statements in C MCQs Page

Dive deep into the fascinating world of Control Flow Statements in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Control Flow Statements in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Control Flow Statements in C, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Control Flow Statements in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Control Flow Statements in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Control Flow Statements in C MCQs | Page 19 of 32

Q181.
Which of the following statements are correct about the below program?
#include<stdio.h>
int main()
{
    int n = 0, y = 1;
    y == 1 ? n=0 : n=1;
    if(n)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}
Discuss
Answer: (c).Error: Lvalue required
Q182.
Which of the following sentences are correct about a switch loop in a C program
1: switch is useful when we wish to check the value of variable against a particular set of values.
2: switch is useful when we wish to check whether a value falls in different ranges.
3: Compiler implements a jump table for cases used in switch.
4: It is not necessary to use a break in every switch statement.
Discuss
Answer: (b).1,3,4
Q183.
What is the following code segment doing?
void fn( )
 {
 char c;
 cin.get(c);
 if (c != ‘\n’)
 {
     fn( );
     cout.put(c);
 }
 }
Discuss
Answer: (b).The string entered is printed in reverse order.
Discuss
Answer: (b).it is assumed to be present and taken to the true
Discuss
Answer: (d).All of these
Q186.
If c is a variable initialised to 1, how many times will the following loop be executed?
while ((c > 0) && (c < 60))
 {
 loop body
 c ++;
 }
Discuss
Answer: (b).59
Q187.
How many times will the following loop be executed if the input data item is 0 1 2 3 4 ?

while (c = getchar ()! = 0)
{ }
Discuss
Answer: (a).Ininitely
Q188.
Consider following program fragment char c ='a' ;

while (c++ < = 'z')
putchar (xxx) ;

If required output is abcd....xyz, then xxx should be
Discuss
Answer: (c).c-1
Q189.
Which of the following is a tabular listing of contents of certain registers and memory locations at different times during the execution of a program ?
Discuss
Answer: (b).Program trace
Discuss
Answer: (c).To choose from multiple possibilities which may arise due to different values of a single variable

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!