# C Operators MCQ

Operators are symbols that instruct the compiler to perform specific mathematical or logical functions. They can be categorized into Arithmetic, Relational, Logical, Bitwise, Assignment, and Miscellaneous operators.

Let's gauge your understanding of C operators with this interactive quiz tailored for beginners! Each question is followed by the correct answer and an explanation to help reinforce your knowledge.

## 1. Which of the following is a modulus operator in C?

A) %
B) /
C) &&
D) ||

A) %

### Explanation:

The modulus operator (%) returns the remainder of a division operation.

## 2. Which operator is used for bitwise left shift?

A) <<
B) <\
C) <=
D) <

A) <<

### Explanation:

The << operator shifts bits of a number to the left.

## 3. What does the == operator do?

A) Assigns a value
B) Checks for inequality
C) Checks for equality
D) Performs an XOR operation

C) Checks for equality

### Explanation:

The == operator is used to compare two values for equality.

## 4. Which of the following operators has the highest precedence?

A) +
B) *
C) &&
D) ||

B) *

### Explanation:

The multiplication operator (*) has higher precedence than addition, logical AND, and logical OR.

## 5. What will be the value of x after executing this expression: x = 7 + 3 * 2;?

A) 13
B) 20
C) 16
D) 10

A) 13

### Explanation:

According to operator precedence, multiplication is performed before addition. Thus, the result is 13

## 6. Which operator is used for bitwise AND?

A) &&
B) &
C) |
D) ^

B) &

### Explanation:

The & operator performs a bitwise AND operation.

## 7. Which operator can be used to check if both conditions are true?

A) ||
B) &&
C) !
D) ^

B) &&

### Explanation:

The && operator is the logical AND, which checks if both conditions are true.

## 8. The != operator is __________.

A) Logical AND
B) Logical OR
C) NOT equal to
D) Equal to

C) NOT equal to

### Explanation:

The != operator checks if two values are not equal.

## 9. What is the result of the bitwise operation ~4?

A) 4
B) 5
C) -5
D) -4

C) -5

### Explanation:

The ~ operator inverts all the bits. For integer 4, the bitwise representation is 0100. Inverting the bits gives 1011, which represents -5 in Two's Complement form.

## 10. What will be the result of 7 ^ 3?

A) 4
B) 10
C) 5
D) 6

A) 4

### Explanation:

The ^ operator is the bitwise XOR. The operation 7 (0111) XOR 3 (0011) results in 4 (0100).

## 11. Which operator is used for division?

A) %
B) /
C) \
D) //

B) /

### Explanation:

The / operator is used for division in C.

## 12. Which of the following is a post-increment operator?

A) i++
B) i--
C) ++i
D) --i

A) i++

### Explanation:

The i++ operator is the post-increment operator which increases the value of i by 1 after its current value is used.

A) ==
B) =
C) :=
D) <=