Programming for Problem Solving (3110003) MCQs

MCQs of Fundamentals of C

Showing 21 to 30 out of 107 Questions
21.

Choose the correct statement about left shift Operator <<

(a)

Left shift operator shits individual bits on the left side

(b)

When shifting left side, Overflow bits are ignored

(c)

Zeros are filled on the right side

(d)

all of above

Answer:

Option (d)

22.

Choose the correct statement about Right Shift Operator >>

(a)

Right shift operator shifts individual bits on to the right side

(b)

When shifting bits right side, overflow bits on the right are ignored or truncated

(c)

Zeroes are filled on the left side

(d)

all of above

Answer:

Option (d)

23.

Which is bit toggling operator below?

(a)

& Bitwise AND

(b)

| Bitwise OR

(c)

^ Bitwise exclusive OR

(d)

~ Bitwise complement

Answer:

Option (d)

24.

Left Shift operation is equivalent to __________

(a)

Division by 2

(b)

Multiplying by 2

(c)

Adding 2

(d)

Subtrating 2

Answer:

Option (b)

25.

Which of the following is a symbol for logical AND operator?

(a)

||

(b)

&

(c)

&&

(d)

##

Answer:

Option (c)

26.

Right Shift operation >> is equivalent to _________

(a)

Multiplying by 2 

(b)

Division by 2

(c)

Adding 2

(d)

Subtracting 2

Answer:

Option (b)

27.

What will be the value of variable c?

int c = 2 ^ 3;

(a)

1

(b)

8

(c)

9

(d)

0

Answer:

Option (a)

28.

Which of the following is ternary operator?

(a)

??

(b)

:?

(c)

?:

(d)

::

Answer:

Option (c)

29.

What will be the output of following program 

#include<stdio.h>

void main()

{

int x,y=10;

x = y * NULL;

printf("%d",x);

}

(a)

error

(b)

0

(c)

10

(d)

garbage value

Answer:

Option (a)

30.

Which of following is not a valid assignment expression?

(a)

y = 22;

(b)

s = x;

(c)

y%=6;

(d)

z = 5 = 3;

Answer:

Option (d)

Showing 21 to 30 out of 107 Questions