Answer to Question #11243 in C++ for Chad Dylan Cooper

Question #11243
State whether the following are valid switch statements. If not, explain why. Assume that n and digit are int variables.

How can I do this?

switch (digit / 4)
{
case 0,
case 1:
cout << "low." < endl;
break;
case 1,
case 2:
cout << "middle." < endl;
break;
case 3:
cout << "high." < endl;

My error is on the line 12
-expected unqualified-id before "switch"
-expected `,' or `;' before "switch"
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS