switch case program in c++
#include<iostream>
using namespace std;
int main()
{
int a,i=34;
//**********************control structures---if else if statements**********************
cout<<"Enter an integer:";
cin>>a;
switch (a)
{
case 34:
cout<<"\nYou guessed it right"; break;
case 56:
cout<<"\nYour guess is high"; break;
case 23:
cout<<"\nYour guess is low"; break;
default:
cout<<"\nTry next time";
break;
}
return 0;
}
Comments
Post a Comment