Exercises
-
13.6 (Write C++ Statements) Write a statement for each of the following:
Print integer
40000left justified in a 15-digit field.Read a string into character array variable
state.Print
200with and without a sign.Print the decimal value
100in hexadecimal form preceded by0x.Read characters into array
charArrayuntil the character'p'is encountered, up to a limit of 10 characters (including the terminating null character). Extract the delimiter from the input stream, and discard it.Print
1.234in a 9-digit field with preceding zeros.
-
13.7 (Inputting Decimal, Octal and Hexadecimal Values) Write a program to test the inputting of integer values in decimal, octal and hexadecimal formats. Output each integer read by the program ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access