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
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
What is a #include preprocessor?
What is the difference between array and pointer in c?
Is it possible to pass an entire structure to functions?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Should a function contain a return statement if it does not return a value?
How pointers are declared?
How can you find the day of the week given the date?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
What are the various types of control structures in programming?
Explain the difference between malloc() and calloc() in c?
How is a macro different from a function?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
What is a header file?
What does the && operator do in a program code?