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


Please Help Members By Posting Answers For Below Questions

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

2182


What are the 4 types of programming language?

576


Is it possible to execute code even after the program exits the main() function?

805


How to write a code for reverse of string without using string functions?

1575


What is the purpose of & in scanf?

589






What do you understand by normalization of pointers?

619


Is c# a good language?

602


Which built-in library function can be used to match a patter from the string?

737


Explain how can you tell whether two strings are the same?

580


Is there any demerits of using pointer?

621


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 .

1895


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

629


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

574


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

558


Write a program to print fibonacci series using recursion?

581