Reverse string Project | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Reverse string Project

Output : D I J A S why is output not :DIJAS ? https://code.sololearn.com/ci9cL7aX18s2/?ref=app

3rd Jan 2021, 8:13 AM
Sajid Ali
Sajid Ali - avatar
3 Answers
+ 2
i suggest to use System.out.print instead of System.out.println - then everything will be printed in the same line without linefeed after each loop-iteration
3rd Jan 2021, 8:34 AM
Martin Ed
Martin Ed - avatar
+ 2
Thanks ,, now working!
3rd Jan 2021, 8:36 AM
Sajid Ali
Sajid Ali - avatar
+ 1
Sajid Ali println move cursor to next line and print value. So if you want to print in same line then use only print.
3rd Jan 2021, 8:38 AM
A͢J
A͢J - avatar