Question #147617

What is the difference between the following three statements?
cout<<'A';
cout<<"A";
cout<<A;

Expert's answer

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)
LATEST TUTORIALS
APPROVED BY CLIENTS