+ 4

how to create output like this ?

12345 109876 1112131415

17th Aug 2017, 5:55 AM
Deepesh
Deepesh - avatar
10 odpowiedzi
+ 8
In fact, it is an ad hoc way to do so, dear. you can work on it and make it workable for different inputs.
17th Aug 2017, 6:25 AM
Babak
Babak - avatar
+ 8
I see that people already posted answers, but here's the one I've worked on. https://code.sololearn.com/ciO2paW0gWud/?ref=app
17th Aug 2017, 6:28 AM
Limitless
Limitless - avatar
+ 6
int n = 15; for (int i = 1; i <= n; ++i) { if (i >= 6 && i <= 10) { if (i == 6) System.out.println(); System.out.print(n - i + 1); if (i == 10) System.out.println(); } else System.out.print(i); }
17th Aug 2017, 6:23 AM
Babak
Babak - avatar
+ 2
thanks to everyone
17th Aug 2017, 6:32 AM
Deepesh
Deepesh - avatar
+ 2
thanks @sayan it's work
17th Aug 2017, 6:45 AM
Deepesh
Deepesh - avatar
+ 1
check this out @ DEEPESH ENTER TOTAL NUMBER OF LINES..(ROWS) Then enter how many values in each line. seperated by enter like: 5 6 https://code.sololearn.com/cV2I20nMG78z/?ref=app
17th Aug 2017, 6:25 AM
sayan chandra
sayan chandra - avatar
0
thanks but value of n is user define they may be greater then 15 ... In output each row have contain 5 value only
17th Aug 2017, 6:22 AM
Deepesh
Deepesh - avatar
0
deepesh check my program again now give 2 inputs seperated by enter like: 5 7 see what happens
17th Aug 2017, 6:39 AM
sayan chandra
sayan chandra - avatar
- 1
let me know if u have checked it..
17th Aug 2017, 6:42 AM
sayan chandra
sayan chandra - avatar
- 1
let me know if u have checked it
17th Aug 2017, 6:42 AM
sayan chandra
sayan chandra - avatar