InterviewSolution
Saved Bookmarks
| 1. |
Rewrite the following program code using a switch statement.if(code = = 1)Month = "January";else if(code==2)Month = "February";else if(code= =3)Month = "March";else if(code: =4)Month ="April";elseMonth = "No Match"; |
|
Answer» switch(code) { case 1: Month = "January"; break; case 2; break; case 3: Month = "March"; break; case 4: Month ="April"; break; default: Month = "No Match"; } |
|