64 638
Assignments Done
99,2%
Successfully Done
In September 2018

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.
Expert's answer
# 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

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions