How to make a if-else choice
To make a if-else choice
#include
main ()
{ char name [15] , gender ;
cout << "please enter name\n";
cin >> name;
cout<< "please enter gender (m/f)\n";
cin >> gender;
if (gender == 'm')
cout<< " hello!! mr."<<>
else
cout<< " hello!! ms."<
return 0;
}
Result :
No comments:
Post a Comment