0
Help with 2d array
I need to create the following pattern using loops and 2d array: 654321 54321 4321 321 21 1
5 Answers
+ 4
Hy Vanessa
You can post your try or code you made to solve this problem and tell more about where you are stuck in this problem to get better help from community.
+ 3
Do you really need to use array? I think a nested loop will do it. Can you share your code in attempt in solving this? I hope you don't ask people to write it down for you, that's not right : )
+ 2
I think you can adjust the <j> loop like this, it works as I tested it. But you can do without the array too : )
for(j = 0; j < 6 - i; j++)
+ 1
https://code.sololearn.com/c10nj5CnfnNR/?ref=app
this is what i got so far, but i want to get rid of the 0s
+ 1
well if you really must do this way you can either use an if statement inside the j loop like if not 0 print or make the j loop such that the condition j < 6 is dynamic (that is use a variable instead of 6) because the actual size of j is getting smaller with every iteration of i