2.6: Integer Data Types

Ace your homework & exams now with Quizwiz!

Write a hexadecimal integer literal representing the value fifteen.

0xf

Write a literal representing the long integer value twelve million.

12000000L

Qualifying an integer declaration with "unsigned" essentially increases the maximum value of the variable by a factor of

2

Write a long integer literal that has the value thirty-seven

37L

Write a declaration for two integer variables, age and weight.

int age, weight;

Write a declaration of a variable named count that can be used to hold numbers like 90000 and -1 and -406.

int count;

Write a declaration for a variable hits that can hold the number of times a baseball player has hit the ball in a baseball game.

int hits;

Write a declaration of a variable named numberOfWidgets that can be used to hold numbers like 57 and 981 and -4.

int numberOfWidgets;

Write a declaration of a variable named number_of_children that can be used to hold the number of children in a family.

int number_of_children;

Declare a variable populationChange, suitable for holding numbers like -593142 and 8930522.

int populationChange;

Declare two integer variables named profitStartOfQuarter and cashFlowEndOfYear.

int profitStartOfQuarter; int cashFlowEndOfYear;

Declare a long integer variable named grossNationalProduct.

long int grossNationalProduct;

Declare an unsigned integer variable named degreesKelvin.

unsigned int degreesKelvin;


Related study sets

Cell Bio - DNA Structure & Replication

View Set

Maternity and Newborn Medications Qestions

View Set