Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is the mistake in the below switch statement? double a= 1.25; switch(a){ case 1.1: case 1.2: x= x*x; y= x; break; case 1.3: y=
What is the mistake in the below switch statement?
double a= 1.25;
switch(a){
case 1.1: case 1.2:
x= x*x; y= x; break;
case 1.3: y= x*x;
case 2.1: case 3.3:
y= sqrt(x); break;
case 3.5: printf(Error ); break;
default: y= x+1;
a) case 1.3 has no break
b) default doesnt have printf
c) a = 1.25 is not matched.
d) switch works only with integers
e) case 3.5 doesnt need break
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started