wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Type & Operator

Total questions: 15

Worksheet time: 4mins

Name
Class
Date
1.

Which of the following is Ternary Operator ?

a)

condition : true ? false

b)

condition ? false : true

c)

condition : false ? true

d)

condition ? true : false

2.

What is the name of ^ operator ?

a)

Power

b)

2's Complement

c)

XOR

d)

1's Complement

3.

Which of the following is a Bitwise Operator ?

a)

||

b)

|

c)

&&

d)

!

4.

What is the result of 25 >> 3 ?

a)

100

b)

200

c)

2

d)

3

5.

What is the output of : printf("%d", printf("hello\t"))

a)

hello 5

b)

hello 6

c)

5 hello

d)

6 hello

6.

What is the use of unary & operator ?

a)

Bitwise And

b)

Logical And

c)

Address

d)

Pointer

7.

What is the result of following code ?

int x = 10 ;

x =+ 3 ;

printf("%d", x) ;

a)

10

b)

13

c)

3

d)

7

8.

Which of the following is post decrement operator ?

a)

++ x

b)

x ++

c)

-- x

d)

x --

9.

Which of the following is not a Comparison Operator ?

a)

<=

b)

>=

c)

!=

d)

=

10.

What is the output of following statement ?

printf("hello\t") || printf("hii\t") || printf("bye\t")

a)

hello hii bye

b)

bye hii hello

c)

hello

d)

hello hii

11.

What is the format specifier for Signed Short ?

a)

%hu

b)

%hd

c)

%su

d)

%sd

12.

Given n bits, what is the range of signed numbers in 1's Complement ?

a)

- (2n-1) to (2n-1)

b)

- (2n-1-1) to (2n-1-1)

c)

- 2n-1 to (2n-1-1)

d)

- 2n to (2n-1)

13.

Given n bits, how many distinct values can be stored using 1's Complement ?

a)

2n-1

b)

2n

c)

2n-1-1

d)

2n-1

14.

Given 4 bits, how will 8 be stored in signed 2's complement form ?

a)

8

b)

-8

c)

7

d)

-7

15.

Given 4 bits, how will -6 be stored in signed 1's complement form ?

a)

0110

b)

1001

c)

1010

d)

1110