Computer Science, asked by gurjargeetansh1, 6 months ago

what is output of a and p after the execution of following code if value of a=3 int p=a++ + ++a + a + --a system.out.println(a); system.out.println(p);​

Answers

Answered by udayagrawal49
2

Answer:

Value of "a" will be 4 and value of "p" will be 17.

Explanation:

Initially, "a" is 3.

After "a++", "a" is still 3. After "++a", "a" will be 5. In last, due to "--a", "a" will be 4.

⇒ p = 3 + 5 + 5 + 4

or p = 17

Please mark it as Brainliest.

Similar questions