Display output to console
In c++, cout is used to display the data to the console. The statement #include <iostream> is used add the file - iostream to the source code. The file - iostream (input-output-stream) is used by cout and its related function.Syntax of cout ?
Type cout followed by insertion operator (<<) followed by your data and terminate it by semi-colon. The following program demonstrates the use of cout that displays integers, decimal equivalents string and so on.
A C++ Program example that demonstrate the various implementation of c++ cout
#include <iostream>
int main ()
{
std::cout << "Lets have a look on cout !!" << endl;
std::cout << "The number 99 : " << 99 << endl;
std::cout << "The sum of of 9 + 8 : " << 9 + 8 << endl;
std::cout << "The division of 7 / 18: "<< float (7 / 18) << endl;
std::cout << "The multiplication of 6000 & 6000: "
<< double (6000 * 6000) << endl;
std::cout << "Replace Mohammed Homam with your name ..."
<< std::endl;
std::cout << "Mohammed Homam is a C++ programmer"
<< std::endl;
return 0;
}