Using more than one cout statements in c++

display multiple cout in c++ by balochprogrammer

Posted by Zohaib Qazi on may 15, 2017

Using more than one cout statment in c++

After reading This post you will simply come to know how to use multiple cout display statement on screen and by using more than one cout display statement in c++. Also a C++ balochi video is shown below if you want to watch it then check it below

Introduction to Multiple cout Display

mostly, in c++ everyone use one cout display statemnt and get confuse on, that how to show more than one cout statement in c++. however, it is too easy to use multiple cout statement in your c++ program by coding. here we are to help you regarding displaying more cout statements in c++ by balochprgorammer

Multiple cout

Before knowing multiple cout statments you must know that how to display one cout statement. and then you will come to know displaying multiple couts on screens.

At first, let me declare one cout statement code which is too simple.

cout << " Baloch Programmer " ;

And do not forget to miss less than operators , double quotes and semicolon while displaying c++ cout display.

Now let’s move toward multiple cout display statement code which is show below:

cout << "Baloch Programmer " ;
cout << “ Baloch Programmer ” ;

New Line Character (\n)

The \n newline which takes screen display into nextline. So the output of above multiple cout display is shown below:
Baloch Programmer Baloch Programmer

The both statemnets output is on same line and being display after each. So by using \n newline Character which is a build in feature of c++ and which separetes both into next line. And the code is shown below:


cout << "Baloch Programmer One \n";
cout << " Baloch Programmer Second \n Baloch Programmer Third”;

The output :

Baloch programmer one
Baloch Prgorammer Second
Baloch Programmer Third

End Line or Break Line (endl)

If you do not desire to use \n newline character then use endl which means end line which works same as \n newline character. And the code is show below:

cout << " Baloch Programmer One ” << endl ;
cout << " Baloch Programmer Two ” << endl ;

The Output :
Baloch Programmer One
Baloch Programmer Two

Using more than one cout c++ Video in Balochi

Using more than one cout code by balochprgorammer


#include < iostream >
using namespace std;
int main()
{

cout << " Baloch Programmer One \n ";
cout << " Baloch Programmer Second \n Baloch Programmer Third”;

cout << " Baloch Programmer One ” << endl;
cout << " Baloch Programmer Two ” << endl;
return 0 ;
}