Programming in C - Operators and Expressions

16. Pick the operators whose meaning is context dependent

  • Option : D
  • Explanation :
    Often the precedence of an operator depends on the context. For example, a minus sign typically has a very high precedence as a unary operator and somewhat lower precedence (lower than multiplication) as a binary operator.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


17. Which of the following comments about the ++ operator are correct?

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


18. The expression 5 -2 - 3 * 5 - 2 will evaluate to 18, if

  • Option : C
  • Explanation :
    5 - 2 -3 *5 -2 will yield 18, if it is treated as (5-(2-3)) * (5-2).
    i.e if - has precedence over * and if it associates from the right.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


19. The expression 4 + 6 / 3 * 2 - 2 + 7 % 3 evaluates to

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


20. Choose the correct statements

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *