Program to switch between different cases.
#include <iostream>
#include <string>
using namespace std;
int main(){
int a;
cout
<< "Enter Number" << endl;
cin
>> a;
string ans;
switch (a) {
case 1: ans = "Sunday";
break;
case 2: ans = "Monday";
break;
case 3: ans = "Tuesday";
break;
case 4: ans = "Wednesday";
break;
case 5: ans = "Thusrsday";
break;
case 6: ans = "Friday";
break;
case 7: ans = "Saturday";
break;
default: ans = "not currect try again.";
}
cout
<< ans << endl;
system("pause");
return 0;
}
Comments
Post a Comment