Question discussion

Consider the expression given below:The variables have the following values:If the variables are of integer data type, then what will be th…

359460Medium DSSSB TGT Computer Science 0 replies 0 views
0
Consider the expression given below:
The variables have the following values:
If the variables are of integer data type, then what will be the value of after evaluating the above expression?

Figure for question 156

Figure for question 156

Figure for question 156

  • A24
  • B26
  • C20
  • D21
Correct answer: B

Explanation

x = 8 + 5 × (10 − 3) / 2 + 7 % 3. Using integer arithmetic: 5 × 7 = 35, 35 / 2 = 17, 7 % 3 = 1, so x = 8 + 17 + 1 = 26.

Discussion 0

Nobody has replied yet. Start the discussion!