In this case the output appears on a single line as Goodbye, cruel world!. Notice in main that there is a space between βGoodbye,β and the second quotation mark. This space appears in the output, so it affects the behavior of the program.
Listing2.1.3.This program accomplishes the same thing as the one above. The difference is that there are no spaces separating the different components of each line.
This program would compile and run just as well as the original. The breaks at the ends of lines (newlines) do not affect the programβs behavior either, so I could have written:
Listing2.1.4.This program accomplishes the same thing as the two above, but it only uses one line. However, this format is pretty messy and relatively hard to follow.
That would work, too, although you have probably noticed that the program is getting harder and harder to read. Newlines and spaces are useful for organizing your program visually, making it easier to read the program and locate syntax errors.
Construct a main function that prints βSnap!β on the first line, βCrackle!β on the third line, and βPop!β on the sixth line. You might not use all of endl blocks provided.