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 13 of 32

Explore more Topics under C Programming

Q121.
What will be the final value of the digit?
void main()
{
   int digit = 0;
   for( ; digit <= 9; )
   digit++;
   digit  *= 2;
   --digit;
}
Discuss
Answer: (c).19
Q122.
What will be the following code's output if choice = 'R'?
switch(choice)
{
   case 'R' : printf("RED");
   case 'W' : printf("WHITE");
   case 'B' : printf("BLUE");
   default  : printf("ERROR");break;
}
Discuss
Answer: (b).RED WHITE BLUE ERROR
Q123.
Consider the following program fragment. What would be the value of sum for the input 1, -1, 2, -2, 3, -3, 4, -4, 5, -5
Discuss
Answer: (d).15
Q124.
What will be printed if the following code is executed?
void main()
{
   int x=0;
   for( ; ; )
   {
      if( x++ == 4 ) break;
      continue;
   }
   printf("x=%d", x);
}
Discuss
Answer: (b).x=5
Q125.
What is the output of the below code?
void main()
{
   int a[5] = {6,8,3,9,0}, i=0;
   if(i != 0)
   {
      break;
      printf("%d", a[i]);
   }
   else
      printf("%d", a[i++]);
}
Discuss
Answer: (d).Syntax error
Q126.
Determine Output:
void main()
{
      int i=3;
      switch(i)
      {
            default: printf("zero");
            case 1: printf("one"); break;
            case 2: printf("two"); break;
            case 3: printf("three"); break;
      }
}
Discuss
Answer: (b).three
Q127.
Determine Output:
void main()
{
      char string[]="Hello World";
      display(string);
}
void display(char *string)
{
      printf("%s", string);
}
Discuss
Answer: (b).Compiler Error
Q128.
Determine Output:
void main()
{
      int i=5;
      printf("%d%d%d%d%d", i++, i--, ++i, --i, i);
}
Discuss
Answer: (a).45545
Q129.
Determine Output:
void main()
{
      int i=1, j=2;
      switch(i)
      {
            case 1: printf("GOOD"); break;
            case j: printf("BAD"); break;
      }
}
Discuss
Answer: (c).Compiler Error
Q130.
Determine Output:
void main()
{
      int i;
      printf("%d", scanf("%d", &i)); // value 10 is given as input here
}
Discuss
Answer: (b).1

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!