ICSE Class 10 Computer Applications Question 13 of 26

Operators in Java — Question 13

Back to all questions
13
Question

Question 13

What will be the output of the following if x=5?
i. 5 * ++x
ii. 5 * x++

Answer

i.  5 * ++x
⇒ 5 * 6
⇒ 30

ii.  5 * x++
⇒ 5 * 5
⇒ 25