Home » » cout - Standard output stream C++ Example program

cout - Standard output stream C++ Example program

 

 cout - Standard output stream

The 'cout' object pronounced as "See Out". The cout stands for 'Console Output'. The cout is a C++ standard output stream object. It is used to display values and results on the screen by using statements. This stream is used to show the flow of data from computer to memory screen. It is the part of "iostream.h" header file.
 

The general Syntax of 'cout' is:

 

In this simple program let us discuss about 'cout' and other used tokens.

#include : It is preprocessor directive that is instructions for compiler to include something before compiling the source code into object code.

<iostream.h> : It is header file included at the start of the program in include preprocessor. It is called "Input Output Stream". If in the program we use input and output objects then it is necessary to include this header file because this header file contain all methods and functions of 'cout' and 'cin' stream objects.
 
Main () : Every program must have a function with name main because actual execution of the C++ program will start from the main function. When program executes control goes directly to the main function. () brackets are used to write arguments of that function. Empty brackets shows that main function accepts no arguments.

Deliminators {}: To indicate the boundary of main function we use curly brackets. { is called starting bracket and } is called ending bracket. They are called deliminators.

cout : It is name of output stream object. It stands for 'Console Output'.
<< : It is knows as Insertion operator or put to operator. It sends the output (contents of variables or constants or expression) to the cout object. The cout object than sends the output to the display screen. You can use multiple insertion operators to display the values of multiple Variables and Constants. 

"Welcome to CS Adventures" : It is constant String litral.

LIKE US

Popular Posts

My FANS around the WORLD

Flag Counter