Review Questions

  1. Which data type would you use for each of the following kinds of data?

    1. The population of Rio Frito.

    2. The average weight of a Rembrandt painting.

    3. The most common letter in this chapter.

    4. The number of times that the letter occurs in this chapter.

  2. Why would you use a type long variable instead of type int?

  3. Identify the type and meaning, if any, of each of the following constants:

    1. '\b'

    2. 1066

    3. 99.44

    4. 0XAA

    5. 2.0e30

  4. Virgila Ann Xenopod has concocted an error-laden program. Help her find the mistakes.

    include <stdio.h>
    main
    (
     float g; h;
     float tax, rate;
     g = e21;
     tax = rate*g;
    )
    
  5. Identify the data type (as used in declaration statements) and the printf() format specifier for each of the following constants:

    Constant Type Specifier
    a. 12

Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.