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
Is there any data type in c with variable size?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
Explain how does flowchart help in writing a program?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What is pointer to pointer in c with example?
What does s c mean in text?
write a program to create a sparse matrix using dynamic memory allocation.
What is 02d in c?
What is this infamous null pointer, anyway?
What does a function declared as pascal do differently?
What do you mean by dynamic memory allocation in c? What functions are used?
Explain bit masking in c?
What is the advantage of c?
What are the applications of c language?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none