Result of the following program is
main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i)
case 0:i+=5;
case 1: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
e)syntax error
Answer Posted / sankar
Answer is (e) Option : Syntax error
void main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i)
case 0:i+=5; // this is illegal
case 1:i+=2; // this is illegal
case 5:i+=5; // this is illegal
default i+=4; // Colon is missing
break;
}
printf("%d,",i);
}
} // This is extra braces
Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
write a c program for swapping two strings using pointer
What does c mean in standard form?
What is main function in c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What is use of #include in c?
What is string constants?
What is the advantage of using #define to declare a constant?
Can we declare variable anywhere in c?
Tell us something about keyword 'auto'.
What is a buffer in c?
In a switch statement, what will happen if a break statement is omitted?
Can an array be an Ivalue?
Write program to remove duplicate in an array?
What are the different types of errors?
Explain how can you be sure that a program follows the ansi c standard?