Answer to Question #5275 in C++ for zuhaib abbasi

Question #5275
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
2011-11-22T12:27:05-0500
# include<iostream.h>
# include<conio.h>
void main(){
char a;
cout<<"Please enter a letter: ";
cin>>a;
if (a=='m') cout<<"You are male";
else cout<<"You are female";
getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Rehan Riaz
01.10.23, 05:04

Magnificent

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS