C - Control Flow Constructions Questions and Answers
Practice ModeShowing 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);
}
}
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++);
}
Answer: Option B