The cout
statement may be used to print the information stored in any variable
location to the screen.
It is possible to intermix several types of variables into one cout
statement as seen
below:
int num1 = 4;
double num2 = 6.5;
cout << num1 << " and also " << num2 << endl;
or for easier reading:
cout << num1
<< " and also "
<< num2
<< endl;
Numbers and/or computations may also be printed without variable names: