Ask Question

1. What will the println statement in the following program segment display? int x = 5; System. out. println (x++); a. 5 b. 6 c. 0 d. None of these

+5
Answers (1)
  1. Yesterday, 17:29
    0
    Answer: a) 5

    Explanation:

    x+ + increases the value of x by 1 (=6), but still returns the old value (5) to the print statement

    following code lines will use the new x=6 value
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “1. What will the println statement in the following program segment display? int x = 5; System. out. println (x++); a. 5 b. 6 c. 0 d. None ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers