0

Please anyone can help me ?How can I add space between one output in java?

Please anyone can help me ? How can I add space between one output in java?

15th Jun 2021, 6:26 AM
Ash Inno
Ash Inno - avatar
4 Answers
+ 2
for(int i=1;i<=5;i++){ System.out.print(i+" "); }
15th Jun 2021, 7:07 AM
Nanda Balakrishnan
0
System.out.println("hi" + " "+"hello"); will have space inbetween
15th Jun 2021, 6:37 AM
Nanda Balakrishnan
0
Thanks you
15th Jun 2021, 7:19 AM
Ash Inno
Ash Inno - avatar
- 1
My input: There are multiple groups of input. Each group has a number not more than 5 digits My output: For each input number, output according to three lines: Number of digits in the first row Separate each digit with a space on the second line, note that there is no space after the last digit The third line outputs this number in reverse order. For example, when I input "12345" the Output will be 5 1 2 3 4 5 54321 But my output is 5 12345(How to add space here?) 54321
15th Jun 2021, 6:59 AM
Ash Inno
Ash Inno - avatar