wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

45. Programming 1 : Data Types and Casting

Total questions: 1

Worksheet time: 7mins

Name
Class
Date
1-10.
1.

What data type should be used to store a whole number?

a)

Boolean

b)

String

c)

Integer

d)

Float

2.

Which data type uses more memory to store the number 22?

a)

Float

b)

Boolean

c)

Character

d)

Integer

3.

What is the result of concatenating '8' and '5' if they are stored as strings?

a)

13

b)

85

c)

40

d)

None of the above

4.

What command is used to convert a data type into a string?

a)

INT

b)

FLOAT

c)

BOOL

d)

STR

5.

What data type should be used to store a user's age?

a)

Boolean

b)

String

c)

Integer

d)

Character

6.

Why should a telephone number be stored as a string?

a)

Because it represents a true or false value

b)

Because it is a whole number

c)

Because it can start with a zero

d)

Because it contains letters

7.

What is casting in programming?

a)

A type of data structure

b)

A method of inputting data

c)

Changing a data type from one type to another

d)

Changing a variable's value

8.

Which of the following is NOT a data type mentioned in the text?

a)

Integer

b)

Real

c)

Character

d)

Array

9.

What data type should be used to store a flag indicating if something has happened or not?

a)

Float

b)

Boolean

c)

Integer

d)

String

10.

What is the correct data type for storing a person's name?

a)

String

b)

Integer

c)

Boolean

d)

Character