+ 1

Why array value doesn't get assigned?

I'm new to java Sample input 123 array gets 000 but It should be 321 ? https://code.sololearn.com/c1vjRLqO9Vx8/#java

11th Jan 2020, 3:06 PM
Aditya Kumar
Aditya Kumar - avatar
3 Réponses
+ 3
Switch these two lines, like this: System.out.println(arr[i]); i++; Then it will work.
11th Jan 2020, 3:13 PM
Paul
Paul - avatar
+ 3
You are printing values that haven't been changed yet
11th Jan 2020, 3:15 PM
Paul
Paul - avatar
+ 1
Thanks👍
11th Jan 2020, 3:22 PM
Aditya Kumar
Aditya Kumar - avatar