wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CLab 12

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

In the given code, what message is appropriate to display?

int status = (num & 1);

if(status==1)

printf(what msg will you print here?? );

a)

num is even

b)

num is odd

c)

num is prime

d)

num is negative

2.

Left shift of a number N is always multiple of 2.

a)

True

b)

False

3.

What will be the output of the following code:

int a = 2;

printf("%d", a>>3);

a)

4

b)

-1

c)

8

d)

16

4.

When applied to a variable, what does the unary "&" operator yield?

a)

The variable's address

b)

The variable's right value

c)

The variable's binary form

d)

The variable's value

5.

When applied to a variable, what does the unary "&" operator yield?

a)

The variable's address

b)

The variable's right value

c)

The variable's binary form

d)

The variable's value

6.

The operator "&" is used for

a)

Bitwise AND

b)

Bitwise OR

c)

Logical AND

d)

Logical OR

7.

An expression contains relational, assignment and arithmetic operators. If parenthesis are not specified, the order of evaluation of the operators would be:

a)

assignment, arithmetic, relational

b)

relational, assignment, arithmetic

c)

assignment, relational, arithmetic

d)

arithmetic, relational, assignment

8.

enum status = { flag=1, flag=3};

printf("%d", sizeof(status));

a)

1

b)

2

c)

3

d)

4

9.

int a=4;

printf("%d", a>>2);

a)

0

b)

1

c)

2

d)

8

10.

int b=8;

printf("%d", a<<2);

a)

4

b)

2

c)

16

d)

32