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 / vinod
int 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);
}
}
For the above program the output would be 16 and 21
| Is This Answer Correct ? | 36 Yes | 6 No |
Post New Answer View All Answers
What is the scope of static variable in c?
How many types of operator or there in c?
When should you use a type cast?
Why dont c comments nest?
what are the different storage classes in c?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
What is echo in c programming?
Write a function that will take in a phone number and output all possible alphabetical combinations
Write the control statements in C language
how we can make 3d venturing graphics on outer interface
Why isnt there a numbered, multi-level break statement to break out
If I have a char * variable pointing to the name of a function ..
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What is the difference between typedef and #define?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers