ICSE Class 10 Computer Applications Question 22 of 30

Solved 2023 Question Paper ICSE Class 10 Computer Applications — Question 22

Back to all questions
22
Question

Question 2(ii)

Evaluate the expression when the value of x = 4:

x *= --x + x++ + x

Answer

The given expression is evaluated as follows:

x *= --x + x++ + x (x = 4)
x *= 3 + x++ + x (x = 3)
x *= 3 + 3 + x (x = 4)
x *= 3 + 3 + 4 (x = 4)
x *= 10 (x = 4)
x = x * 10 (x = 4)
x = 4 * 10
x = 40