Sports GK Questions and Answers 2024 (Latest Updated)

Awards & Honours GK Questions 2024 (Latest Updated)

Question

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

Advertisement
Article and Schedule Quiz Start Test!
DOWNLOAD CURRENT AFFAIRS PDF FROM APP

Random GK Questions

Assam Direct Recruitment Test Series

Computer Science Topics