11. Suppose I have a variable called num whose value has already been set. Write a switch statement that will print "One" if the value of num is 1, "Two" if the value of num is 2, and "Three" if the value of num is 3.
1
Expert's answer
2013-02-08T06:01:01-0500
#include <iostream> #include <conio.h>
using namespace std;
int main() { int number; cout<<"Enter number (1,2 or 3): "; cin>>number; switch(number){ case 1: cout<<"One"; break; case 2: cout<<"Two"; break; case 3: cout<<"Three"; break; } getch(); return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment