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 / jai
Answer is e), since opening and closing flower braces do
not match in numbers and default do not have colon
following it. Assuming switch(i) has an opening flower
brace and default has colon after it "switch(i) {, ...
default: i+= 4;"answer would be d).
All cases will be fall-through including default:
Is This Answer Correct ? | 27 Yes | 5 No |
Post New Answer View All Answers
What is the use of typedef in structure in c?
Why do we use null pointer?
What is the size of array float a(10)?
What is the purpose of clrscr () printf () and getch ()?
Is a pointer a kind of array?
What is pointer to pointer in c with example?
where are auto variables stored? What are the characteristics of an auto variable?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What is break in c?
can any one tel me wt is the question pattern for NIC exam
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
How can I delete a file?
How do we declare variables in c?
What is s or c?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(