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 / sankar
Answer is (e) Option : Syntax error
void main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i)
case 0:i+=5; // this is illegal
case 1:i+=2; // this is illegal
case 5:i+=5; // this is illegal
default i+=4; // Colon is missing
break;
}
printf("%d,",i);
}
} // This is extra braces
| Is This Answer Correct ? | 4 Yes | 8 No |
Post New Answer View All Answers
What are 'near' and 'far' pointers?
What is the difference between Printf(..) and sprint(...) ?
What is include directive in c?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
Between macros and functions,which is better to use and why?
Explain what is the difference between text files and binary files?
What is external variable in c?
What is dynamic memory allocation?
Describe the order of precedence with regards to operators in C.
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
What is local and global variable in c?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
Explain about block scope in c?
Explain how can I convert a number to a string?
How can I delete a file?