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 | 8 No |
Post New Answer View All Answers
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the difference between procedural and functional programming?
Is c is a middle level language?
Tell me can the size of an array be declared at runtime?
What are extern variables in c?
What are the 4 types of unions?
Can you apply link and association interchangeably?
Why we use void main in c?
i want to know the procedure of qualcomm for getting a job through offcampus
What is ctrl c called?
How important is structure in life?
How is a macro different from a function?
What is hungarian notation? Is it worthwhile?
Write a program to check armstrong number in c?
What is the meaning of c in c language?