Multiple Choice Operators

 Multiple Choice Questions

Question 1

Which of the following is the correct precedence of logical operators?

  1. !, &&, ||
  2. &&, !, ||
  3. ||, !, &&
  4. &&, ||, !

Question 2

Choose the odd one out from the following:

  1. > 
  2. ==
  3. &&
  4. < 

Question 3

Given: String st = (a>= 90)? "Excellent": "Best";
Predict the output, when a = 90.

  1. Best
  2. Excellent: Best
  3. Best: Excellent
  4. Excellent

Question 4

Choose the odd one out from the following:

  1. Unary operator
  2. Binary operator
  3. Ternary operator
  4. Bitwise operator

Question 5

Given: x += x++ + ++x + --x
Find the value, when x=5.

  1. 23
  2. 21
  3. 22
  4. 24

 

No comments:

Post a Comment