0

UNABLE TO UNDERSTAND THE LOGIC OF THIS PATTERN HENCE FAILED TO WRITE THE CORRECT CODE OF THIS PROGRAM

The pattern is this 12345 34567 56789 78901 90123 Guys, Pls help me out to write the source code in java bluej

5th Sep 2021, 6:34 AM
JusCodin'Bro
3 odpowiedzi
+ 1
What code have you written so far ?
5th Sep 2021, 9:49 AM
Abhay
Abhay - avatar
+ 1
JusCodin'Bro FIRST, PLEASE BUY A NEW KEYBOARD! YOUR CAPS LOCK KEY SEEMS TO BE BROKEN! Next, there are many ways to do things like you want here. I will give you a hint for one of them. But if you don't FULLY understand, what's going on here, you should not use this as your own solution. Look at this and make your own one! int start = 1; for (int line=1;line<=5;line++){ for (int i=start;i<start+5;i++){ System.out.print(i%10); } System.out.println(); start = (start + 2) % 10; }
5th Sep 2021, 1:04 PM
Coding Cat
Coding Cat - avatar
- 2
int count=0; for(int i=1;i<10;i++){ System.out.print(i); count++; if(count==5){ count=0; System.out.println(); for(int j=2;j>=0;j--){ System.out.print(i-j); count++; } }
5th Sep 2021, 7:27 AM
Patel