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


Please Help Members By Posting Answers For Below Questions

What is the use of typedef in structure in c?

536


Why do we use null pointer?

601


What is the size of array float a(10)?

651


What is the purpose of clrscr () printf () and getch ()?

591


Is a pointer a kind of array?

596






What is pointer to pointer in c with example?

544


where are auto variables stored? What are the characteristics of an auto variable?

584


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2019


What is break in c?

580


can any one tel me wt is the question pattern for NIC exam

1551


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

759


How can I delete a file?

626


How do we declare variables in c?

561


What is s or c?

589


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.. :(

1731