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 / mayank sharma
when the control will encounter break statement.it will move
outside the loop. which will not pass through printf();and
also braces are not properly put
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What is pass by reference in functions?
Why does this code crash?
What is file in c preprocessor?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What are global variables and how do you declare them?
What is the heap?
What is FIFO?
Explain low-order bytes.
How do shell structures work?
What are the features of c language?
Why do we use int main instead of void main in c?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
Explain what are preprocessor directives?
How can a program be made to print the name of a source file where an error occurs?