java - Using Loops to print patterns -
O people, that's why I'm working on a problem where I need to print
1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
public class set_5_P5_18b {public static zero main (string [] args ) {Int x; String wi; X = 1; Y = ""; System.out.println ("Pattern B:"); Whereas (x <7) {y = y + x + ""; X ++; } System.out.println (y); }}
which I wrote above the first line of print but I did not know how to modify it to print another, can someone help me?
The UO requires a loop from 1 value to external 6. For every value you need an internal loop of X that runs for value 1 ... x and prints the values in one line.
Keep this in mind and try to come up with the pretend code first and then the implementation code