Sail E0 Webinar

MCQs

Total Questions : 24 | Page 3 of 3 pages
Question 21. Which of these operators can skip evaluating right hand operand?
  1.    !
  2.    |
  3.    &
  4.    &&
 Discuss Question
Answer: Option D. -> &&


Operator short circuit and, &&, and short circuit or, ||, skip evaluating right hand operand when output can be determined by left operand alone.


Question 22. Which of these statement is correct?
  1.    true and false are numeric values 1 and 0.
  2.    true and false are numeric values 0 and 1.
  3.    true is any non zero value and false is 0.
  4.    true and false are non numeric values.
 Discuss Question
Answer: Option D. -> true and false are non numeric values.


true and false are keywords, they are non numeric values which do no relate to zero or non zero numbers. true and false are boolean values.


Question 23.

Which of the following operators can operate on a boolean variable?

 1. &&

 2. ==

 3. ?:

 4. +=

  1.    3 & 2
  2.    1 & 4
  3.    1, 2 & 4
  4.    1, 2 & 3
 Discuss Question
Answer: Option D. -> 1, 2 & 3


Operator Short circuit AND, &&, equal to, == , ternary if-then-else, ?:, are boolean logical operators. += is an arithmetic operator it can operate only on numeric values.


Question 24. Which of these have highest precedence?
  1.    ()
  2.    ++
  3.    *
  4.    >>
 Discuss Question
Answer: Option A. -> ()


Order of precedence is (highest to lowest) a -> b -> c -> d.


Latest Videos

Latest Test Papers