0% found this document useful (0 votes)
3 views63 pages

Opreater in C 300 MCQs in One Step Is Highly Extensive Paid Member

Uploaded by

sakshii1629
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views63 pages

Opreater in C 300 MCQs in One Step Is Highly Extensive Paid Member

Uploaded by

sakshii1629
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Creating 300 MCQs in one step is highly extensive, so I'll begin by compiling a high-

quality, well-structured batch of 50 MCQs covering operators in C programming. This


batch will include a diverse range of questions about arithmetic, relational, logical, and
bitwise operators appropriate for lower secondary grade students but with exam-level
rigor similar to ISRO, DRDO, NET, LT grade IT, and GATE medium.

Once you review this batch, I can continue generating subsequent batches (50 each)
until we reach 300.

MCQs on Operators in C Programming (Batch 1 of 6)

1. Which symbol represents the modulus operator in C?

o A. %

o B. #

o C. &

o D. $

2. What will be the output of printf("%d", 7 / 3);?

o A. 2.33

o B. 2

o C. 3

o D. 2.0

3. Which operator has the highest precedence?

o A. +

o B. *

o C. =

o D. %

4. What does the expression (5 == 5) evaluate to in C?

o A. 0

o B. 1

o C. 5

o D. Error

5. What operator is used for bitwise AND?


o A. &&

o B. &

o C. |

o D. ^

6. What is the result of (3 > 2) && (2 > 3)?

o A. 1

o B. 0

o C. 2

o D. True

7. The logical OR operator in C is:

o A. ||

o B. |

o C. ^^

o D. &&

8. What will a be after a = 5; a += 3;?

o A. 5

o B. 3

o C. 8

o D. 15

9. What is the output of printf("%d", ~5); (assuming 32-bit int)?

o A. -6

o B. 6

o C. -5

o D. 5

10. Which is a relational operator?

o A. =

o B. !=

o C. &&
o D. ++

11. The result of 5%% 2 is:

o A. 1

o B. 0

o C. 2

o D. 5

12. Which operator increases the value of a variable by 1?

o A. ++

o B. --

o C. +=

o D. -

13. How do you check if a is not equal to b in C?

o A. a =! b

o B. a != b

o C. a == b

o D. a & b

14. What will printf("%d", 8 >> 2); output?

o A. 2

o B. 4

o C. 8

o D. 1

15. The operator = is called:

o A. Equal to

o B. Assignment

o C. Comparison

o D. Conditional

16. The expression a && b evaluates to true if:

o A. Either a or b is true
o B. Both a and b are true

o C. Both a and b are false

o D. Neither a nor b is true

17. In C, a | b is:

o A. Logical OR

o B. Bitwise OR

o C. Bitwise AND

o D. Logical AND

18. What is the value of ++a if a is 5?

o A. 5

o B. 6

o C. 7

o D. Undefined

19. Which operator is used to access the address of a variable?

o A. *

o B. &

o C. ->

o D. %

20. How is the size of a variable determined in C?

o A. Using sizeof operator

o B. Using length operator

o C. Using size function

o D. Using count operator

21. What is the result of 5 & 3 (bitwise AND)?

o A. 1

o B. 7

o C. 0

o D. 3
22. The result of logical NOT operator !0 is:

o A. 0

o B. 1

o C. -1

o D. Undefined

23. What is the result of 6 | 2 (bitwise OR)?

o A. 0

o B. 2

o C. 6

o D. 6

24. What will be the value of a after a = 10; a -= 4;?

o A. 6

o B. 14

o C. 4

o D. 10

25. Which operator extracts a bit from a number?

o A. >>

o B. <<

o C. ~

o D. ^

26. What does the conditional operator ?: do?

o A. Acts as an IF-ELSE shortcut

o B. Acts as a loop

o C. Performs bitwise AND

o D. Presents error in code

27. Which operator is used to perform XOR operation?

o A. &

o B. |
o C. ^

o D. ~

28. What will be the result of 10 / 4 in C?

o A. 2.5

o B. 2

o C. 3

o D. 2.0

29. The expression (a > b) ? a : b means:

o A. Print a and b

o B. Assign a if condition is true else b

o C. Add a and b

o D. None of these

30. Which operator has the lowest precedence?

o A. *

o B. =

o C. +

o D. ,

31. What is the output of printf("%d", 5 && 0);?

o A. 5

o B. 0

o C. 1

o D. -1

32. The right shift operator (>>) shifts bits to the:

o A. Left

o B. Right

o C. Either side

o D. None

33. Which operator is used to check equality in C?


o A. =

o B. ==

o C. !=

o D. <>

34. What type of operator is ++?

o A. Unary

o B. Binary

o C. Ternary

o D. None

35. What does a-- do?

o A. Decreases a after its use

o B. Decreases a before its use

o C. Increases a after its use

o D. Increases a before its use

36. Which operator is used in C to combine two conditions where both must be true?

o A. &

o B. &&

o C. |

o D. ||

37. Which operator will result in a bitwise negation of x?

o A. ~x

o B. !x

o C. -x

o D. ++x

38. What is the output of printf("%d", 012);? (Where 012 is an octal literal)

o A. 10

o B. 12

o C. 9
o D. Error

39. What does sizeof(char) return?

o A. 1 byte

o B. 2 bytes

o C. 4 bytes

o D. 8 bytes

40. Which operator can combine two numbers bitwise by setting a bit if it is set in
only one operand?

o A. &

o B. |

o C. ^

o D. ~

41. What is the output of printf("%d", 1 || 0);?

o A. 0

o B. 1

o C. 2

o D. Error

42. What does the && operator return if both operands are non-zero?

o A. 0

o B. 1

o C. The value of first operand

o D. The value of second operand

43. Which operator is used to cast types explicitly in C?

o A. cast

o B. ()

o C. {}

o D. <>

44. Which of the following operators can be overloaded in C++ but not in C?
o A. +

o B. -

o C. ==

o D. None; operator overloading is not supported in C

45. What does the , operator do in C?

o A. Separates items in a list

o B. Acts as a sequence point and evaluates left then right

o C. Is invalid in C

o D. None of these

46. Which of the following results in a compilation error in C?

o A. int a = 5 + 3;

o B. int b = 5 / 0;

o C. int c = 5 % 2;

o D. int d = 5 * 2;

47. Which operator performs logical NOT operation?

o A. ~

o B. !

o C. ^

o D. &

48. What will be the output of the expression sizeof(int) on a 4-byte system?

o A. 2

o B. 4

o C. 8

o D. 1

49. In C, which operator is used to dereference a pointer?

o A. *

o B. &

o C. ->
o D. %

50. What is the result of a^a where a is any integer?

o A. a

o B. 0

o C. 1

o D. Undefined

Answers:

1A 2B 3B 4B 5B 6B 7A 8C 9A 10B
11A 12A 13B 14A 15B 16B 17B 18B 19B 20A
21A 22B 23D 24A 25A 26A 27C 28B 29B 30D
31B 32B 33B 34A 35A 36B 37A 38A 39A 40C
41B 42B 43B 44D 45B 46B 47B 48B 49A 50B

I will continue and prepare the next batch of 50 MCQs on operators in C programming,
maintaining the same quality, scope, and format.

MCQs on Operators in C Programming (Batch 2 of 6)

51. Which operator is used to shift bits to the left in C?

• A. >>

• B. <<

• C. ~

• D. &&

52. What is the value of the expression (5 > 3) ? 10 : 20;?

• A. 5

• B. 10

• C. 20

• D. 3

53. What will be the output of printf("%d", 3 && 0);?

• A. 3

• B. 0

• C. 1
• D. -1

54. Which operator is used to test if a bit is set in a number?

• A. &

• B. |

• C. ~

• D. ^

55. What does a /= b mean in C?

• A. a = a + b

• B. a = a - b

• C. a = a / b

• D. a = a % b

56. Which operator can you use to combine two bitwise expressions with AND?

• A. &&

• B. &

• C. |

• D. ||

57. What is the output of the following code snippet?

int a = 1;

printf("%d", a++ + ++a);

• A. 4

• B. 3

• C. 2

• D. Undefined

58. What is the output of printf("%d", 4 << 1);?

• A. 8

• B. 2

• C. 4
• D. 1

59. Which of these checks if a number n is even using bitwise operators?

• A. (n & 1) == 0

• B. (n | 1) == 0

• C. n >> 1

• D. n ^ 1

60. What is the difference between && and & operators?

• A. No difference

• B. && is bitwise AND; & is logical AND

• C. && is logical AND; & is bitwise AND

• D. Both are assignment operators

61. Which of the following is NOT a unary operator in C?

• A. ++

• B. --

• C. *

• D. +

62. What is the result of (!(1 && 0))?

• A. 0

• B. 1

• C. -1

• D. Undefined

63. Which escape sequence is used to print a backslash character \?

• A. \n

• B. \\

• C. \'

• D. \"

64. How does the operator precedence in C treat arithmetic and relational
operators?
• A. Relational operators have higher precedence than arithmetic

• B. Arithmetic operators have higher precedence than relational

• C. Both have equal precedence

• D. Depends on compiler

65. What will be the output of printf("%d", 10 % 3);?

• A. 1

• B. 3

• C. 10

• D. 0

66. Which operator assigns right operand value to left operand and returns left
operand?

• A. Assignment operator =

• B. Equality operator ==

• C. Bitwise AND &

• D. Compound assignment /=

67. What will be the output of the following?

int x = 5;

x *= 2 + 1;

printf("%d", x);

• A. 15

• B. 20

• C. 17

• D. 10

68. Which operator tests whether two operands have different values?

• A. !=

• B. ==

• C. =
• D. <=

69. What is the value of a after execution of int a = 10; a %= 3;?

• A. 1

• B. 0

• C. 3

• D. 10

70. The logical AND operator && is a:

• A. Binary operator

• B. Unary operator

• C. Ternary operator

• D. None of these

71. Which operator would you use to check if a bit is NOT set?

• A. &

• B. |

• C. ~

• D. ^

72. The expression x++ means:

• A. Increment x before its value is used

• B. Increment x after its value is used

• C. Decrement x after its use

• D. Double x

73. What is the output of printf("%d", 7 % 3);?

• A. 3

• B. 1

• C. 0

• D. 7

74. Which operator is used for bitwise XOR operation?

• A. &
• B. |

• C. ^

• D. ~

75. What is the relation between the operators != and ==?

• A. Equivalent

• B. Opposite

• C. Both are equality operators

• D. Both are assignment operators

76. What is the result of !5 in C?

• A. 5

• B. 0

• C. 1

• D. -1

77. What is the result of the expression 5 << 2?

• A. 20

• B. 10

• C. 1

• D. 8

78. What does a ^= b do?

• A. a = a | b

• B. a = a & b

• C. a = a ^ b

• D. a = b

79. Which of these operators is not part of C programming?

• A. ?:

• B. **

• C. ++

• D. ->
80. Which operator returns the size in bytes of a data type or variable?

• A. sizeof

• B. length

• C. size

• D. count

81. The expression a + b * c evaluates as:

• A. (a + b) * c

• B. a + (b * c)

• C. (a + b + c)

• D. (b * c) - a

82. Which of these is a ternary operator?

• A. ? :

• B. ?:

• C. &&

• D. ++

83. What does the operator -> do in C?

• A. Accesses members of a struct through a pointer

• B. Pointer dereference

• C. Assignment

• D. Bitwise OR

84. Which of the following expressions returns true if a is less than or equal to b?

• A. a < b

• B. a <= b

• C. a == b

• D. a >= b

85. What is the correct operator for incrementing a variable's value before its use?

• A. a++

• B. ++a
• C. --a

• D. a--

86. Which operator decreases a variable's value after its use?

• A. a++

• B. ++a

• C. a--

• D. --a

87. What is the output of printf("%d", 12 & 5);?

• A. 12

• B. 5

• C. 4

• D. 8

88. Which of these operators can be used only with integral types?

• A. +

• B. %

• C. &&

• D. ||

89. The operator used to combine two conditions where either can be true is:

• A. ||

• B. &&

• C. &

• D. |

90. What is the output of printf("%d", 0 || 0);?

• A. 0

• B. 1

• C. Error

• D. -1

91. Which of these operators has the right-to-left associativity?


• A. *

• B. =

• C. +

• D. -

92. What is the output of printf("%d", 1 & 2);?

• A. 3

• B. 1

• C. 0

• D. 2

93. The operator & used in the declaration int *p means:

• A. Multiplication

• B. Address of operator

• C. Pointer dereference

• D. Bitwise AND

94. In C, what is the type of the expression a > b?

• A. int

• B. bool

• C. float

• D. void

95. Which operator is used to evaluate two conditions simultaneously?

• A. &

• B. &&

• C. |

• D. ||

96. Which of the following is not a valid operator in C?

• A. **

• B. +=

• C. ==
• D. ||

97. What does the operator ^ do?

• A. Bitwise AND

• B. Bitwise OR

• C. Bitwise XOR

• D. Logical XOR

98. Which operator is used to assign the value from the right to the left operand?

• A. ==

• B. =

• C. !=

• D. <

99. What is the meaning of the operator ++?

• A. Decrement by 1

• B. Increment by 1

• C. Multiply by 2

• D. Divide by 2

100. Which statement about operator precedence is correct?

• A. Logical operators have higher precedence than arithmetic operators

• B. Arithmetic operators have higher precedence than relational operators

• C. Assignment operators have higher precedence than unary operators

• D. Bitwise operators have the highest precedence

Answers:

51B 52B 53B 54A 55C 56B 57D 58A 59A 60C
61D 62B 63B 64B 65A 66A 67A 68A 69A 70A
71C 72B 73B 74C 75B 76B 77A 78C 79B 80A
81B 82B 83A 84B 85B 86C 87C 88B 89A 90A
91B 92C 93C 94A 95B 96A 97C 98B 99B 100B

Please confirm if you want me to proceed to the next batch of 50 MCQs.


Continuing with the next batch of 50 MCQs on C programming operators, same format
and quality.

MCQs on Operators in C Programming (Batch 3 of 6)

101. What will be the output of the following code?

int x = 5, y = 10;

printf("%d", x > y ? x : y);

• A. 5

• B. 10

• C. 15

• D. 0

102. What does the ~ operator do in C?

• A. Logical NOT

• B. Bitwise complement

• C. Bitwise AND

• D. Logical AND

103. What is the value of x after this statement: x = 5 & 3;?

• A. 7

• B. 1

• C. 5

• D. 3

104. Which operator checks if two values are equal?

• A. =

• B. ==

• C. !=

• D. <

105. What type of operator is ?: called?

• A. Unary
• B. Binary

• C. Ternary

• D. Assignment

106. What is the output of printf("%d", 3 || 0);?

• A. 3

• B. 0

• C. 1

• D. Error

107. How many operands does a unary operator have?

• A. 0

• B. 1

• C. 2

• D. 3

108. What is the output of printf("%d", 3 & 2);?

• A. 2

• B. 3

• C. 1

• D. 0

109. Which of these operators is used for bitwise left shift?

• A. >>

• B. <<

• C. >>>

• D. <-

110. What is the effect of a *= b + 2; if a=2 and b=3?

• A. a = a * b + 2 = 8

• B. a = a * (b + 2) = 10

• C. a = a + b + 2 = 7

• D. a = b + 2 = 5
111. What does the operator && return if both operands are non-zero integers?

• A. The first operand

• B. The second operand

• C. 1

• D. 0

112. Which operator comes with right to left associativity?

• A. +

• B. =

• C. *

• D. -

113. What will printf("%d", 15 >> 2); output?

• A. 3

• B. 1

• C. 5

• D. 7

114. What is the output of printf("%d", 0 && 1);?

• A. 1

• B. 0

• C. -1

• D. 2

115. Which operator is used to dereference a pointer in C?

• A. &

• B. *

• C. .

• D. ->

116. What happens when you use the sizeof operator on an array?

• A. Gives number of elements

• B. Gives total size in bytes


• C. Gives size of first element

• D. Gives size of pointer

117. Which of the following operators is used as a logical NOT?

• A. !

• B. ~

• C. ^

• D. !=

118. Which operator is used to evaluate bitwise OR?

• A. ||

• B. |

• C. ^

• D. &

119. If x = 7 and y = 3 what is the result of x ^ y?

• A. 4

• B. 6

• C. 5

• D. 7

120. What will printf("%d", 4 / 2 * 3); output?

• A. 6

• B. 12

• C. 9

• D. 8

121. What does the expression !(a == b) mean?

• A. true if a equals b

• B. true if a does not equal b

• C. true if a less than b

• D. always false

122. What is the value of 5 && 6 in C?


• A. 0

• B. 1

• C. 5

• D. 6

123. What will be the output of printf("%d", 3 & 1);?

• A. 3

• B. 1

• C. 0

• D. 2

124. Which operator in C has the highest precedence?

• A. Assignment (=)

• B. Arithmetic (*, /, %)

• C. Unary Operators (++, --, !)

• D. Logical AND (&&)

125. Which C operator can be used to increment the value of a variable by a


specified value?

• A. ++

• B. +=

• C. -

• D. --

126. What does the expression b <<= 1; do?

• A. Shifts bits in b one place to the right

• B. Shifts bits in b one place to the left

• C. Adds 1 to b

• D. Decreases b by 1

127. Which operator returns true if either of the two conditions is true?

• A. &&

• B. ||
• C. !

• D. ~

128. What does the = operator do in C?

• A. Compares two operands

• B. Assigns value from right to left operand

• C. Adds two operands

• D. Checks if two operands are equal

129. What is the result of the expression 12 % 5?

• A. 2

• B. 3

• C. 4

• D. 5

130. Which operator is used to concatenate two strings in C?

• A. +

• B. &

• C. .

• D. None; C uses functions like strcat()

131. In C, which operator evaluates expressions from left to right?

• A. Assignment (=)

• B. Addition (+)

• C. Logical AND (&&)

• D. Comma operator (,)

132. Which operator can you use to write short-circuit logical AND?

• A. &

• B. &&

• C. |

• D. ||

133. What will this output: printf("%d", 5 < 3);


• A. 0

• B. 1

• C. 3

• D. 5

134. If a = 5 and a++ executed, what will the value of a be immediately after
this statement?

• A. 4

• B. 5

• C. 6

• D. Undefined

135. Which operator performs logical XOR in C?

• A. ^

• B. !=

• C. None; logical XOR operator doesn't exist in C

• D. |

136. What is the output of printf("%d", 0 || 0);?

• A. 1

• B. 0

• C. -1

• D. Error

137. What does 10 >> 1 do?

• A. Shifts bits to the right by 1

• B. Shifts bits to the left by 1

• C. Divides 10 by 2

• D. Multiplies 10 by 2

138. Which operator is used to perform a bitwise NOT in C?

• A. !

• B. ~
• C. ^

• D. &

139. Which operator is used to test inequality in C?

• A. ==

• B. !=

• C. =

• D. <

140. What is the result of 5 + 4 * 2 in C?

• A. 18

• B. 13

• C. 14

• D. 9

141. What happens when you use the assignment operator inside an
expression? e.g. a = b = 5;

• A. Assigns 5 to b, then b to a

• B. Assigns b to a, then 5 to b

• C. Assigns 5 to a only

• D. Causes error

142. What is the correct way to comment in C?

• A. // Single line comment

• B. /* Multi line comment */

• C. Both A and B

• D. # Comment

143. Which operator can be used to get the remainder of division?

• A. /

• B. %

• C. *

• D. -
144. What is the output of printf("%d", !(0));?

• A. 0

• B. 1

• C. -1

• D. Error

145. Which bitwise operator sets bits to 1 if both bits are 1?

• A. &

• B. |

• C. ^

• D. ~

146. Which one evaluates a logical expression and returns either true or false?

• A. The relational operators

• B. Arithmetic operators

• C. Bitwise operators

• D. All of the above

147. Which operator do you use to combine two expressions with a comma?

• A. ;

• B. ,

• C. :

• D. .

148. What is the output if a is 4, and you execute a >>= 1;?

• A. 2

• B. 3

• C. 1

• D. 8

149. Which of the following is used to compare two values for equality?

• A. =

• B. ==
• C. !=

• D. <

150. What does the statement a &&= b; mean in C?

• A. Logical AND assignment, valid in C

• B. Logical AND assignment, invalid in C

• C. Bitwise AND assignment

• D. Assignment operator combined with AND

Answers:

101B 102B 103B 104B 105C 106C 107B 108C 109B 110B
111C 112B 113A 114B 115B 116B 117A 118B 119A 120A
121B 122B 123B 124C 125B 126B 127B 128B 129B 130D
131D 132B 133A 134C 135C 136B 137A 138B 139B 140B
141A 142C 143B 144B 145A 146A 147B 148A 149B 150B

Please confirm if you want me to proceed with the next batch of 50 MCQs.

Continuing with the next batch of 50 MCQs on C programming operators.

MCQs on Operators in C Programming (Batch 4 of 6)

151. How many types of operators are there in C?

• A. 3

• B. 5

• C. 7

• D. 10

152. Which operator will return the memory address of a variable?

• A. *

• B. &

• C. ->

• D. %

153. What is the output of printf("%d", 9 >> 2);?

• A. 2

• B. 1
• C. 3

• D. 4

154. What is results of logical AND expression 0 && 5?

• A. 0

• B. 1

• C. 5

• D. Undefined

155. Which operator can be used to force evaluation from right to left?

• A. =

• B. &&

• C. ?:

• D. = with right to left associativity

156. What is the output of printf("%d", 10 % 3);?

• A. 3

• B. 1

• C. 0

• D. 2

157. Which operator is used to negate a condition in C?

• A. +

• B. !

• C. -

• D. ~

158. What does the expression a += 10; mean?

• A. a = 10

• B. a = a + 10

• C. a = a - 10

• D. a += a + 10

159. What will be the output of printf("%d", !(3 > 2));?


• A. 0

• B. 1

• C. 2

• D. Error

160. What will be the result of 7 | 2 (bitwise OR)?

• A. 5

• B. 3

• C. 7

• D. 1

161. Which operator is used to combine two conditions in an if statement


where only one needs to be true?

• A. &&

• B. ||

• C. &

• D. !

162. Which operator is executed last in the expression a + b * c?

• A. +

• B. *

• C. a

• D. b

163. What does ++a do?

• A. Increments before use

• B. Increments after use

• C. Decrements after use

• D. Does not change value

164. Which operator is used to compare if two variables are not equal?

• A. ==

• B. !=
• C. =

• D. <

165. What is printed by printf("%d", 10 - 5 * 2);?

• A. 10

• B. 0

• C. 5

• D. -10

166. What type of operator is sizeof in C?

• A. Unary

• B. Binary

• C. Ternary

• D. Assignment

167. What will be the output of printf("%d", 8 & 5);?

• A. 8

• B. 5

• C. 0

• D. 0

168. Which is an incorrect statement about relational operators?

• A. They return 1 or 0

• B. They can be chained in expressions

• C. They compare values

• D. They modify the operands

169. Which operator can be used for compound assignment?

• A. +=

• B. ===

• C. ==

• D. <>

170. Which operator will check if an expression is true or false?


• A. ==

• B. !

• C. &&

• D. All of these

171. What will happen if division by zero occurs in C?

• A. Returns zero

• B. Returns infinity

• C. Causes runtime error

• D. Returns undefined

172. What is the output of the expression 5 / 2 * 2?

• A. 4

• B. 5

• C. 2

• D. 1

173. Which operator changes the value of a variable and returns the original
value?

• A. ++a

• B. a++

• C. --a

• D. a--

174. The bitwise operator that flips each bit of its operand is:

• A. ~

• B. !

• C. ^

• D. |

175. What is the output of printf("%d", 4 && 5);?

• A. 1

• B. 0
• C. 4

• D. 5

176. Which operator concatenates strings in C?

• A. +

• B. .

• C. strcat()

• D. &

177. What is the effect of a -= 2;?

• A. Decreases a by 2

• B. Sets a to 2

• C. Increases a by 2

• D. Doubles the value of a

178. Which of the following operators can only be applied to integer types?

• A. &&

• B. &

• C. ||

• D. ==

179. What does the following print statement output?

int a = 5;

printf("%d", a > 3 ? 100 : 200);

• A. 5

• B. 100

• C. 200

• D. 3

180. Which operator returns the remainder of a division?

• A. /

• B. %
• C. *

• D. -

181. The operator != checks for:

• A. Equal values

• B. Non-equal values

• C. Greater than or equal to

• D. Less than

182. What is the meaning of a = b + c * d;?

• A. Adds all variables first then assigns

• B. Multiplies c and d then adds b, assigns to a

• C. Assigns b to a first

• D. None of the above

183. Which operator is right-associative?

• A. *

• B. =

• C. +

• D. /

184. What is the output of printf("%d", 1 ^ 1); (where ^ is bitwise XOR)?

• A. 0

• B. 1

• C. 2

• D. Error

185. What does the prefix operator --a do?

• A. Decrements a and then evaluates

• B. Evaluates a and then decrements

• C. Increments a and then evaluates

• D. Increments a after evaluating

186. Which operator sets a bit if it is 1 in either operand but not both?
• A. &

• B. |

• C. ^

• D. ~

187. Which of these operators can evaluate two expressions and return the
last expression’s value?

• A. |

• B. &&

• C. ,

• D. ==

188. What will be the output of printf("%d", 0 || 1);?

• A. 0

• B. 1

• C. 2

• D. Error

189. What is the role of the comma (,) operator?

• A. Separates items in a function call

• B. Evaluates two expressions in sequence and returns the last

• C. Concatenates values

• D. None of the above

190. Which operator in C is used for the conditional expression?

• A. ?:

• B. ,

• C. &&

• D. ||

191. The bitwise left shift operator (<<) moves bits:

• A. Left, filling with zeros

• B. Right, filling with zeros


• C. Left, filling with ones

• D. Right, preserving sign bits

192. What will be printed after:

int x = 3;

printf("%d", x--);

• A. 3

• B. 2

• C. 1

• D. 4

193. Which operator can be used to check whether two pointers point to the
same address?

• A. =

• B. ==

• C. !=

• D. &

194. What is the outcome of the expression: ~0 in 32-bit integer?

• A. 0

• B. -1

• C. 1

• D. Undefined

195. Which of the following is NOT a bitwise operator in C?

• A. ^

• B. ~

• C. &&

• D. |

196. What is the output of printf("%d", 12 / 5);?

• A. 2
• B. 2.4

• C. 3

• D. 2.0

197. Which operator in C increases the value of a variable by 1 before it is


used?

• A. a++

• B. ++a

• C. a--

• D. --a

198. Which of the following statements about the ternary operator ?: is true?

• A. It is a unary operator

• B. It requires three operands

• C. It returns multiple values

• D. It can only be used with integers

199. What is the output of printf("%d", 15 & 7);?

• A. 7

• B. 8

• C. 15

• D. 0

200. Which operator is used in C to dereference a pointer to access the value it


points to?

• A. *

• B. &

• C. ->

• D. %

Answers:

151C 152B 153C 154A 155D 156B 157B 158B 159A 160C
161B 162A 163A 164B 165B 166A 167C 168D 169A 170D
171C 172A 173B 174A 175A 176C 177A 178B 179B 180B
181B 182B 183B 184A 185A 186C 187C 188B 189B 190A
191A 192A 193B 194B 195C 196A 197B 198B 199A 200A

Please confirm if you want me to proceed with the next batch of 50 MCQs.

Here is batch 5 (201–250), focusing on advanced, exam-style operator MCQs for C


programming. These reflect the pattern and standard of ISRO, DRDO, NET, LT Grade IT,
and medium GATE examinations.

MCQs on Operators in C (Batch 5: Advanced/Competitive Pattern)

201. What will be the output of this code?

int a = 4, b = 2;

printf("%d", a+++b);

• A. 6

• B. 7

• C. 5

• D. 4

202. Given int a = 5;, what is the result of a = a++ + ++a;?

• A. 12

• B. 13

• C. 11

• D. Undefined

203. Which statement best describes the effect of precedence in the


expression x = a | b & c?

• A. | evaluated before &

• B. & evaluated before |

• C. Both are evaluated left to right

• D. Both have equal precedence

204. Consider:

int x = 1, y = 2;
if (x++ || ++y)

printf("%d %d", x, y);

What is printed?

• A. 2 4

• B. 1 3

• C. 2 2

• D. 2 3

205. Which operator cannot be overloaded in C (and C++)?

• A. []

• B. ()

• C. ::

• D. +

206. What is the result of printf("%d", -7%3);?

• A. 2

• B. -1

• C. 1

• D. -2

207. What will be printed by:

unsigned int x = 0xAAAA;

printf("%x", x << 1);

• A. 15554

• B. 15555

• C. 55554

• D. 55555

208. Which of the following is guaranteed to execute only once, regardless of


the loop's condition?

• A. for loop
• B. while loop

• C. do-while loop

• D. None

209. In the expression int res = a++ + ++a;, what is the sequence of value
evaluation?

• A. Post increment, pre increment

• B. Pre increment, post increment

• C. Left to right only

• D. Undefined behavior

210. Evaluate:

int a = 8;

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

• A. 3

• B. 4

• C. 2

• D. 1

211. What will be the output?

printf("%d", (unsigned)-1 >> 1);

on a system with 32-bit unsigned int.

• A. 2147483647

• B. 4294967295

• C. -1

• D. 0

212. What is the output of the below?

int a = 3;
a = a-- - --a;

printf("%d", a);

• A. 1

• B. 3

• C. 0

• D. -1

213. Which operator is not associative in C?

• A. Add (+)

• B. Ternary (?:)

• C. Logical AND (&&)

• D. Bitwise OR (|)

214. The result of printf("%d", 7 & 9 | 4 ^ 5); is:

• A. 8

• B. 13

• C. 6

• D. 12

215. What is the result of:

int a = 20;

a ^= a;

printf("%d", a);

• A. 20

• B. 10

• C. 0

• D. 1

216. Which operator is evaluated last (lowest precedence)?

• A. *

• B. sizeof
• C. ,

• D. &&

217. The operator precedence and associativity of ! and sizeof is:

• A. Equal precedence, right to left associativity

• B. Equal precedence, left to right associativity

• C. ! > sizeof, both right to left

• D. sizeof > !, both left to right

218. Evaluate:

int a = 2, b = 3, c = 4;

a += b *= c;

printf("%d %d", a, b);

• A. 14 12

• B. 13 12

• C. 6 7

• D. 12 14

219. In C, which operator sequence matches this precedence: *, +, =, ,?

• A. * > + > = > ,

• B. , > = > * > +

• C. = > * > + > ,

• D. + > * > = > ,

220. What is the output of

printf("%d", 5 && 2 | 3);

• A. 3

• B. 1

• C. 0

• D. 2
221. Given int a = 0xF0 & ~0x0F;, what will be the value of a?

• A. 0xF0

• B. 0x0F

• C. 0x00

• D. 0xF0

222. Which expression demonstrates short-circuit evaluation?

• A. a & b

• B. a | b

• C. a && b

• D. a + b

223. The sizeof operator returns value in:

• A. bits

• B. bytes

• C. characters

• D. floats

224. Given char *s = "ABC"; What is value of *(s+1)?

• A. 'A'

• B. 'B'

• C. 'C'

• D. 'D'

225. What is the result of this code?

int a = 1;

printf("%d", ++a + a++);

• A. 3

• B. 4

• C. 5

• D. Undefined
226. For the code printf("%d", 3 > 2 > 1);, what will be the output?

• A. 1

• B. 0

• C. -1

• D. 2

227. Which operator has right-to-left associativity?

• A. assignment (=)

• B. addition (+)

• C. subtraction (-)

• D. division (/)

228. What does x |= 2 do?

• A. x = x + 2

• B. x = x & 2

• C. x = x | 2

• D. x = x * 2

229. What is the value after executing:

int a = 16;

int r = a >> 2;

• A. 2

• B. 4

• C. 8

• D. 1

230. What is printed after:

int x = 10, y = 12, z = 0;

z = x > 10 ? x : y > 10 ? y : 0;

printf("%d", z);
• A. 10

• B. 12

• C. 0

• D. 22

231. Evaluate: printf("%d", (int)3.7);

• A. 3

• B. 4

• C. 3.7

• D. Error

232. Which statement about the comma operator is correct?

• A. Evaluates rightmost operand, ignores left

• B. Evaluates left, then right, returns right

• C. Evaluates right, then left, returns left

• D. Concatenates strings

233. The statement int *p, q; declares:

• A. p as int pointer, q as int

• B. p and q as int pointers

• C. p as int, q as pointer

• D. syntax error

234. What is output of printf("%d", 5 && 0 || 10);

• A. 1

• B. 0

• C. 10

• D. -1

235. Which operator will have the lowest precedence in this expression: x = y +
z * w;?

• A. =

• B. +
• C. *

• D. /

236. What will be the output of printf("%d", 1 || 2 && 0);?

• A. 1

• B. 0

• C. 2

• D. Error

237. If int x = 5; then x = x-->x - x--; evaluates to:

• A. -1

• B. 0

• C. Undefined

• D. 1

238. What is the value of:

int x = 5;

int y = x++ + ++x;

printf("%d", y);

• A. 11

• B. 12

• C. 10

• D. Undefined

239. Given the code:

int a = 10, b = 12;

int c = a & b | a ^ b;

What is value of c?

• A. 6

• B. 4
• C. 2

• D. 8

240. What will be output?

if (printf("")) printf("yes");

else printf("no");

• A. yes

• B. no

• C. yesno

• D. nothing

241. What is the output of printf("%d", sizeof('a')); in C?

• A. 1

• B. 2

• C. 4

• D. 0

242. The result of printf("%d", 15 > 14 > 0); is:

• A. 1

• B. 0

• C. -1

• D. Error

243. If int y = 2; y *= 3 + 2;, value of y is:

• A. 10

• B. 8

• C. 12

• D. 7

244. Operator precedence determines:

• A. The order of operand access

• B. The order of evaluation in an expression


• C. Data type conversion

• D. Associativity

245. Which operator will result in 0 if both operands are same?

• A. &

• B. |

• C. ^

• D. ~

246. If int x = 8; printf("%d", x << 2);, output is:

• A. 16

• B. 24

• C. 32

• D. 8

247. What is printed?

int x = 1;

if (x = 0)

printf("yes");

else

printf("no");

• A. yes

• B. no

• C. Error

• D. nothing

248. Which of these is not a bitwise operator?

• A. &

• B. ^

• C. &&

• D. |
249. What does !(!2) evaluate to?

• A. 0

• B. 1

• C. 2

• D. Error

250. What is the result of printf("%d", 5 == 5.0);?

• A. 1

• B. 0

• C. Error

• D. -1

Answers:

201A 202C 203B 204C 205C 206B 207A 208C 209D 210B
211A 212C 213B 214B 215C 216C 217A 218A 219A 220B
221A 222C 223B 224B 225B 226B 227A 228C 229B 230B
231A 232B 233A 234A 235A 236A 237C 238B 239A 240B
241C 242B 243A 244B 245C 246C 247B 248C 249B 250A

Here is the final batch (251–300) of advanced MCQs on C programming operators,


modeled after ISRO, DRDO, NET, LT Grade IT, and medium GATE pattern standards.
These focus on operator precedence, tricky evaluation, pointer and bitwise use,
undefined behaviors, and advanced concepts encountered in competitive exams.

MCQs on Operators in C (Batch 6: Advanced/Competitive Pattern)

251. What is the result of the following code?

int a = 10;

printf("%d", a+++a++);

• A. 21

• B. 20

• C. 22

• D. 19

252. What does int b = 3; b = b++ * ++b; evaluate to?


• A. 12

• B. 15

• C. Undefined

• D. 9

253. Which is the correct output for:

int a = 1, b = 2;

printf("%d", a+++b+++a);

• A. 5

• B. 6

• C. Compiler error

• D. 4

254. The result of printf("%d", (5, 10, 15)); is:

• A. 5

• B. 10

• C. 15

• D. 0

255. What is the value of ‘x’ in:

int x = (sizeof(int) > -1) ? 1 : 0;

• A. 0

• B. 1

• C. Depends on machine

• D. Error

256. Which is the result of:

int a = 5, b = 0;

if (a && b++)
printf("%d", b);

else

printf("%d", b);

• A. 0

• B. 1

• C. 5

• D. 6

257. Which operator has higher precedence among the following?

• A. &&

• B. ||

• C. ==

• D. ^

258. What would the following print?

unsigned int x = 0xFFFFFFF0;

printf("%x", x >> 4);

• A. FFFFFFF

• B. 0xFFFFFFF

• C. FFFFFFF0

• D. FFFFFFFF

259. Result of:

#define FUN(a,b) a*b

printf("%d", FUN(2+3,3+5));

• A. 64

• B. 25

• C. 23

• D. 27
260. The bitwise result of 0xff & 0x0f | 0xf0 is:

• A. 0xff

• B. 0x0f

• C. 0xf0

• D. 0x00

261. Evaluate:

int a = 4;

int b = (a++ > 4) && (a++ == 6);

printf("%d %d", a, b);

• A. 5 1

• B. 5 0

• C. 6 0

• D. 6 1

262. For

int arr[4] = {1, 2, 3, 4};

printf("%d", 2[arr]);

the output will be:

• A. Compile error

• B. 2

• C. 3

• D. 4

263. Which of the following expressions is always true?

• A. x ^ x

• B. x & x

• C. x | 0

• D. x & 0
264. What’s the output?

int x = 2;

int y = x++ * x++;

printf("%d", y);

• A. 4

• B. 6

• C. 8

• D. 10

265. In C, precedence among !=, &&, ||, == is:

• A. != > == > && > ||

• B. ==, != > && > ||

• C. && > || > ==, !=

• D. == > != > && > ||

266. Which is the result of sizeof('A') == sizeof(1) on most C compilers (32-bit)?

• A. True (1)

• B. False (0)

• C. Compiler Dependent

• D. Error

267. What will this print?

int a = 5;

printf("%d", ~a + 1);

• A. -5

• B. 5

• C. -6

• D. 6

268. If
c

int a=0;

printf("%d", a++ + ++a);

What is printed?

• A. 1

• B. 2

• C. 0

• D. 3

269. Which is a side effect operator in C?

• A. &&

• B. ||

• C. ++

• D. ==

270. What is the result for:

int a= 2, b = 5, c = 8;

printf("%d", a++ + ++b * c--);

• A. 43

• B. 42

• C. 41

• D. 47

271. Which one is NOT a valid C operator?

• A. &&

• B. and

• C. ++

• D. ->

272. Which statement about sizeof(float) == sizeof(int) is most correct?

• A. Always true
• B. Always false

• C. May be true, depends on machine

• D. Compiler error

273. Given

int arr[] = {1,2,3,4};

printf("%d", *(arr+2));

What is printed?

• A. 3

• B. 2

• C. 1

• D. 4

274. What is the output?

int x = 1;

x = (x++, ++x, x + 1);

printf("%d", x);

• A. 3

• B. 2

• C. 4

• D. 5

275. For what values of x and y will x/y > 1 be undefined behaviour?

• A. x and y positive

• B. y == 0

• C. x == 0

• D. x negative

276. True or False: ++*ptr increments the value pointed to by ptr.

• A. True
• B. False

• C. Error

• D. Compiler dependent

277. What is the output for:

int x = 7; x ^= x;

printf("%d", x);

• A. 0

• B. 7

• C. 1

• D. -7

278. Which is NOT a valid C assignment operator?

• A. +=

• B. =+

• C. *=

• D. /=

279. Result of printf("%d", (6 & 3) << 1); is:

• A. 2

• B. 4

• C. 6

• D. 8

280. Which operator group is left-associative?

• A. Assignment

• B. Comma

• C. Arithmetic

• D. Subscript ([])

281. What is the output of:

c
int a=1, b=2, c=3;

a += b += c;

printf("%d %d %d", a, b, c);

• A. 6 5 3

• B. 5 6 3

• C. 6 2 3

• D. 6 5 3

282. The value of:

int z = 0;

z = (1, 2, 3);

printf("%d", z);

• A. 1

• B. 2

• C. 3

• D. Error

283. Which C statement is FALSE?

• A. Short-circuit evaluation applies to && and ||

• B. Bitwise operators have higher precedence than comparison

• C. The comma operator has lower precedence than assignment

• D. The increment operator is binary

284. Which will print "1"?

int i = 0;

printf("%d", ++i && i++);

• A. 0

• B. 1

• C. 2
• D. -1

285. If

int x = 7;

printf("%d", x++ + x++ + ++x);

What is printed?

• A. 24

• B. 23

• C. 21

• D. Error

286. The size of sizeof('A') in C is usually:

• A. 4

• B. 2

• C. 1

• D. 8

287. Output for printf("%d", 2.5 > 2 ? 2 : 3); :

• A. 2

• B. 3

• C. Error

• D. 2.5

288. Result of

int i = 0;

printf("%d", i++ < ++i);

• A. 1

• B. 0

• C. -1

• D. Error
289. Which is a correct explanation of the purpose of *p++?

• A. Increment pointer, dereference old value

• B. Dereference pointer, increment the value pointed

• C. Increment pointer, dereference new value

• D. None of these

290. Which operators in C can never be overloaded (even in C++)?

• A. ->

• B. .

• C. *

• D. =

291. Consider:

int a = 5;

if(a = 0)

printf("zero");

else

printf("nonzero");

Output?

• A. zero

• B. nonzero

• C. Compile error

• D. Undefined

292. Which is the output for:

int x = 0, y = 0;

printf("%d", (x++ && ++y));

printf(" %d", x);

• A. 1 1
• B. 1 0

• C. 0 1

• D. 0 0

293. If int a=3, b=4; what is the result of printf("%d", a < b > 2);?

• A. 0

• B. 1

• C. -1

• D. 2

294. Value of:

int x = 10;

x = x++ + ++x;

• A. 22

• B. 21

• C. 23

• D. Undefined

295. True or False: Bitwise shifts on signed ints are always IEEE-defined.

• A. True

• B. False

• C. Only for left shift

• D. Only for right shift

296. Output of:

int x = 2;

x *= x + 4;

printf("%d", x);

• A. 8

• B. 10
• C. 12

• D. 6

297. What is the value of:

int y = 5 & 3 | 2 ^ 7;

• A. 7

• B. 6

• C. 5

• D. 4

298. Which is the result of:

int x = 1;

x += x += 1;

printf("%d", x);

• A. 2

• B. 3

• C. 4

• D. 1

299. What about sizeof(printf("abc"))?

• A. 1

• B. 4

• C. Size of int

• D. Depends on result of printf

300. In expression a = b+++c;, the operation performed is:

• A. (b++) + c

• B. b + (++c)

• C. b++ + c

• D. Error
Answers:

251A 252C 253A 254C 255B 256A 257C 258A 259D 260A
261B 262C 263B 264B 265B 266A 267A 268B 269C 270C
271B 272C 273A 274C 275B 276A 277A 278B 279B 280C
281A 282C 283D 284B 285B 286A 287A 288A 289A 290B
291B 292C 293A 294B 295B 296A 297A 298B 299C 300C

You might also like