Question: What is wrong with the following switch statement? int ans; cout ' Type y for yes on n for noln: cin ans; switch ( ans
What is wrong with the following switch statement? int ans; cout Type y for yes on for noln": cin ans; switch ans
I
case :
case : cout "You said yesin";
break;
case :
case N: cout "You said noln";
break
default cout invalid answer ;
a ans is a int
b break is illegal syntax
c nothing
d there are no break statements on cases
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
