C
Q. What will be the output of the following C code?
#include <stdio.h> int main(){ char grade = 'B'; switch (grade) { case 'A': printf("Excellent!\n"); case 'B': case 'C': printf("Well done\n"); case 'D': printf("You passed\n"); case 'F': printf("Better try again\n"); break; default: printf("Invalid grade\n"); } }
There is no break statement in case B, Case C, case D. the code will fall through executing all the print statements.
You must be Logged in to update hint/solution
Q. What is a C FILE data type?
Q. Which C keyword is used to extend the visibility of variables?
Q. Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ?
Q. What is an Array in C language.?
Q. The standard header _______ is used for variable list arguments (…) in C.
Q. What is the output of C program?
Q. What is the output of C program with structures?
Q. What is the output of C Program with switch statement or block?
Discusssion
Login to discuss.