- 1
What output results from the following code? int x = 14; System.out.println(x++); Output is 15 Still showing wrong ans.
13 Respuestas
+ 2
Definitely 14. The value is assigned before the increment.
+ 1
ie. change to ++x for the answer to be 15
0
15 is correct.
0
The good output i think is 14, cause the "x++" first use the previous value of x to do what u want, then increments the variable.
So it will output 14, then increments the value of x to 15.
0
If it is showing 15, that's because you need to remember that println is a function. If I pass the value of (x++) onto a function, then the input is fifteen.
0
output is 14 but the system stores 15
0
In the number 15 and 14 1 is green and 4 or 5 is red
i thought then 1 is the right answer so when I typed 1 it was green but said it is wrong so it might be 1 and a variable
0
The Answer is 14
0
answer in 14
- 1
but its showing wrong
- 1
thnx to benji solo
- 1
cool
- 2
What is it showing? And if you post your code in the playground, I could see for myself and let you know.