wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSNP-04103 C++ Chapter 7 - Different Data Types

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What do we use the #define compiler directive for?.

a)

Load a C++ library or class.

b)

Define constants

c)

Define variables

d)

Load functions

2.

Is #define the newest way to define constants?.

a)

True

b)

False

3.

Are integer numbers stored in memory as hexadecimals?.

a)

True

b)

False

4.

Are floating-points numbers stored in memory as binary numbers using scientific notation composed of Mantissa, sign and exponent?.

a)

True

b)

False

5.

What is the largest integer data type in C++?

a)

short

b)

int

c)

long long int

d)

long long double

6.

What is the largest floating-point data type?.

a)

long long short

b)

long double

c)

long long long float

d)

double

7.

The value of average in: int average = float (10/2); is

a)

5.0

b)

5

c)

5.0000000

d)

1/2

8.

In order to get the ASCII representation of a character your cast the character using int(' ')?.

a)

True

b)

False

9.

In order to print the ASCII symbol you cast the number representation as int( );

a)

True

b)

False

10.

What does the function toupper(char); does?.

a)

It converts numbers to a higher precision.

b)

It rounds numbers to the next integer.

c)

It converts lower case characters to uppercase.

d)

it converts upper case characters to lowercase.