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 ? | 35 Yes | 5 No |
Post New Answer View All Answers
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
What are the 4 types of programming language?
Is it possible to execute code even after the program exits the main() function?
How to write a code for reverse of string without using string functions?
What is the purpose of & in scanf?
What do you understand by normalization of pointers?
Is c# a good language?
Which built-in library function can be used to match a patter from the string?
Explain how can you tell whether two strings are the same?
Is there any demerits of using pointer?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
Write a program to print fibonacci series using recursion?