Formatting of output is handled in different ways in the various languages used today. Many programming languages have different formatting instructions for the standard output device which is usually the monitor (going to a DOS black screen output box) versus using the monitor as a Graphical User Interface (GUI). File storage output is often handled similarly to the standard output device. All of this makes formatting of output very machine, output device and language dependent.
When teaching programming fundamentals, many professors prefer to use the standard output device. For the C++ programming language this means going to the monitor using a DOS black screen output box.