Write a Program in C++ to input a single letter in a char variable. If "m" is input print "You are male" otherwise print "You are female" by using conditional expression operator.
1
Expert's answer
2014-03-31T14:30:45-0400
#include <iostream>
using namespace std;
int main() { char character;
cout<<"Please input the character"<<endl; cin>> character; if (character == 'm') { cout<<"You are mail"<<endl; } else { cout<<"You are feemale"<<endl; }
Comments
Leave a comment