Answer to Question #147617 in C++ for Usama Saleem

Question #147617
What is the difference between the following three statements?
cout<<'A';
cout<<"A";
cout<<A;
1
Expert's answer
2020-11-29T23:46:38-0500
cout<<'A'; // prints letter A on screen of type "char"
cout<<"A"; // prints letter A on screen of type "string"
cout<<A; // prints the value of "variable" A on screen

char type variable can hold only single character 
string type can hold multiple characters
There are different types of variables like (int, bool, char, string, double and other)

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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog