Control Structures MCQs

155 questionsC-ProgramPage 6 of 18

Practice free Control Structures multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 155 questions — no login required.

Question 46hard
Which command is used to skip the rest of a loop and carry on from the top of the loop again?
Question 47easy
What is the output of the following program?
#include<stdio.h>
int c[10] = {1,2,3,4,5,6,7,8,9,10};   
main()
{
   int a, b=0;
   for(a=0;a<10;++a)
      if(c[a]%2 == 1)
         b+=c[a];
   printf("%d", b);
}
Question 48easy
What is the output of the following statements?
for(i=10; i++; i<15)
   printf("%d ", i);
Advertisement
Question 49medium
The type of the controlling expression of a switch statement cannot be of the type ........
Question 50medium
What's wrong in the following statement, provided k is a variable of type int? for(k = 2, k <=12, k++)
Question 51hard
Find the output of the following program.
#include<stdio.h>
void main()
{
   int y=10;
   if(y++>9 && y++!=10 && y++>11)
      printf("%d", y);
   else
      printf("%d", y);
}
Advertisement
Question 52hard
What will be the value of sum after the following program is executed?
void main()
{
   int sum=1, index = 9;
   do{
      index = index – 1;
      sum *= 2;
   }while( index > 9 );
}
Question 53easy
What is the right choice, if the following loop is implemented?
void main()
{
   int num = 0;
   do{
      --num;
      printf("%d", num);
   }while( ++num >= 0 );
}
Question 54hard
What will be the final value of the digit?
void main()
{
   int digit = 0;
   for( ; digit <= 9; )
   digit++;
   digit  *= 2;
   --digit;
}