Which of the following creates a variable that can store whole numbers only? a. int numItems=0; b. int numItems='0'; c. int numItems="0"; or d. interger numItems=0;
The answer depends on what you call a whole number. The mathematical whole number can be stored in various ways.
For example, a 3 could be stored in an int. But a .3 could also be stored in an int as a 3. In the second case, the programmer has "scaled" the value so that a decimal appears as a whole number.
Your example code uses 0, '0', "0" etc as values. Are these whole numbers in your definition?