endl.cpp

The endl manipulator inserts a new line into the output stream and flushes the output buffer. Notice that endl may appear anywhere, not just at the end of an output statement (see the last group of output statements in the program below).

#include <iostream>
using namespace std;

int main()
{
	cout << "See the quick red ";
	cout << "fox jump over the ";
	cout << "lazy brown dog." << endl;

	cout << endl;

	cout << "See the quick red" << endl;
	cout << "fox jump over the" << endl;
	cout << "lazy brown dog." << endl;
    
	cout << endl << "See the quick red" << endl;
	cout << "fox jump" << endl << "over the" << endl;
	cout << "lazy brown dog." << endl;
    
	return 0;
}

Output:

See the quick red fox jump over the lazy brown dog.

See the quick red
fox jump over the
lazy brown dog.

See the quick red
fox jump
over the
lazy brown dog.