0
How to print the added value?
I tried changing the code as follows: 1. made the return type int instead of void for method addOneto 2. added "return num;" at the end of that method I thought doing this make the code print 6, but it only printed 5. why is that? what should I do to make it print 6? https://code.sololearn.com/czSzBe74jD8Y/?ref=app
2 Respostas
0
You need to set the returned value to a variable:
x = addOneTo(x);
0
Matthias thanks a lot... ✌️✌️