Sail E0 Webinar
Question


Point out the error, if any in the program.


#include<stdio.h>
int main()
{
int a = 10;
switch(a)
{
}
printf("This is c program.");
return 0;
}
Options:
A .  Error: No case statement specified
B .  Error: No default specified
C .  No Error
D .  Error: infinite loop occurs
Answer: Option C

There can exists a switch statement, which has no case.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers