ExamVeda
Login
Home
This question belongs to C Program Control Structures
Control Structures
?

What will be the output of the given program?
#include<stdio.h>
void main()
{
	float num=5.6;
	switch(num){
		case 5:printf("5");
		case 6:printf("6");
		default : printf("0");
			break;

	}
	printf("%d", num);
}

Answer & Solution
Correct Answer: Option D

compiler error switch expression is not integral. switch statement cannot work on float value.

Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.