C - Control Flow Constructions
C - Control Flow Constructions
61. 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);
}
}
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);
}
}
- 0,5,9,13,17
- 5,9,13,17
- 12,17,22
- 16,21
62. 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++);
}
main ( )
{
int i = 0;
switch (i)
{
case 0 : i++;
case 1 : i+++2
case 2 : ++i;
}
printf ("%d", i++);
}
- 1
- 3
- 4
- 5