Rewrite the switch statement below as a multiple-alternative if statement.
```
switch (jersey) {
case 11:
printf("I. Thomas\n");
break;
case 23:
printf("M. Jordan\n");
break;
case 33:
printf("S. Pippen\n");
break;
default:
printf("Player unknown\n");
}
```
```
if (jersey == 11)
printf("I. Thomas\n");
else if (jersey == 23)
printf("M. Jordan\n");
else if (jersey == 33)
printf("S. Pippen\n");
else
printf("Player unknown\n");
```
Computer Science & Information Technology
You might also like to view...
The general syntax to create a hypertext link is ____.
Computer Science & Information Technology
Rewrite the code below using the for each loop construct provided in C++11.
``` int b[5] = {3,4,5,6,7}; int sum = 0; for (int j = 0; j < 5; j++) sum+=b[j]; ```
Computer Science & Information Technology