Online GK Series

This site is dedicated to the aspirants of competitive exams SSC, UPSC, Railways, Postal Assistants, Bank, GATE and NET

Q.

Find the error in the following program:

	main()
	{
		int m;
		char g;
		switch(m)
		{
			case 3: grade="P";break;
			case 2: grade="Q";break;
			case 1: grade="R";break;
			default: grade="S";break;
		}       		
	}
	

What will be the output of the program?

A Undefined symbol "grade"
B switch statement cannot have more than three labels
C case label cannot be numbers
D none of these
Answer & Explanation
Option: [A]

mcq on c programming conditional statements 01

Computer Science Books

Your Valuable Comments Please...

Please Like Us
Brand