wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

M2 - Topic 5 - Variables & Constants

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

Correct way of integer declaration

a)

int age = 6.6;

b)

integer age = 6;

c)

int age = 6

d)

int age = 6;

e)

integer age = 6.6;

2.

Correct declaration of float variable

a)

float age = 5;

b)

float age = '5';

c)

float age = "5";

d)

float age = 5.5

e)

float age ='5.5'

3.
a)

bool stands for booleye

b)

bool stands for bool_lightsOFF

c)

bool stands for boolean

d)

bool stands for bool_char

e)

bool stands for bool_init

4.

3.14159

a)

is a char

b)

is a int

c)

is a integer

d)

is a String

e)

is a double

5.

Variable can be

a)

Local or Constant

b)

Local or Global

c)

Constant or String

d)

Global or Logical

6.
a)

x_5555 is a valid data type

b)

x_5555 is a not valid data type

c)

x_5555 is a valid variable name

d)

x_5555 is a not valid variable name

7.

a)

not a valid declaration

b)

"8" is not a String

c)

is a valid declaration

d)

should use int

8.

A bool variable declaration can be

a)

TRUE

b)

FALSE

c)

RIGHT

d)

WRONG

9.

Variable names can

a)

use special characters

b)

start with a digit

c)

end with a digit

d)

use special keyword

10.

a)

valid

b)

not valid