Top

Discussion

Point out the error, if any in the program.

#include
int main()
{
    int i = 1;
    switch(i)
    {
        printf("This is c program.");
        case 1:
            printf("Case1");
            break;
        case 2:
            printf("Case2");
            break;
    }
return 0;
}

 

  • A.Error: No default specified
  • B.Error: Invalid printf statement after switch statement
  • C.No Error and prints "Case1"
  • D.None of above

Answer: C

No answer description available for this question.
 

No comment is present. Be the first to comment.
Loading…

Post your comment