C - Control Flow Constructions Questions and Answers

Practice Mode
Showing 10 of 62 questions
Q61
Result of the following program is   main ( )    {      int i = 0;      for ( i = 0 ; i < 20; i++)             {               switch ( i )                     {                       case 0 : i +=5;                        case1 : i +=2;                       case 5 : i +=5;                       default i + = 4 ;                       break;                      }                   printf ("%d,",i); } }
  • A 0,5,9,13,17
  • B 5,9,13,17
  • C 12,17,22
  • D 16,21
Answer: Option D
Q62
 What is the output of the following code ? main ( )    {      int i = 0;     switch (i)     {    case 0 : i++;     case 1 : i+++2    case 2 : ++i;  } printf ("%d", i++); }
  • A 1
  • B 3
  • C 4
  • D 5
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test