This site uses cookies. Only cookies that are necessary for the site to
work or to remember your settings (like language) are used. This site does
not use any tracking cookies.
Learn more about our terms and conditions.
Let's practice printing to both the terminal and to a string variable. This exercise has four different question templates, all of which will require a correct answer to pass.
The computer used in the exercise uses following variable types:
8 bytes for the type (unsigned) long (int)
4 bytes for the type (unsigned) int
2 bytes for (unsigned) short (int)
All values are printed using the decimal system, and floating point values are printed in decimal notation, [-]ddd.ddd, for example.
The Comma Separated Values (CSV) format means that values are printed, for example, as 3.14,2.74,82. The name:value pairs as CSV are printed, for example, as humid:2.22,temp:27.2,light:8. The newline that ends a line depends on the question.
The extra format flags used in this exercise have been added to the Lecture material.