All of the output in the previous example just accumulated on one output line.
It is easy to generate a 'newline' whenever you like.
One way is to output the newline character.
The newline character, like other character constants is written using single quotes like 'a' or 'b'. However, tabs and newlines do not have character representations so an escape mechanism is used.
The backslash, \ before a character means to "escape" the character's usual meaning in the context.
The newline character is represented using this mechanism as '\n'.
Similarly, '\t' represents the tab character.
The predefined name, endl is NOT a character. It is a slightly more compilicated type. However, inserted using operator<<, it has the same effect as inserting the newline character, '\n' AND also forcing the newline to be output NOW!
So for the most part you can either insert the newline character or endl.
One difference is that the newline character can be included in a literal string:
cout << "Hello, world!\n"; or cout << "Hello, world!" << endl;