if you write the problem using code bbcode, it looks better...
you want something like
123456
12345
1234
123
12
1
There are different ways to solve this problem.
I would used a for loop to count how many empty spaces (" ") I need to print before I put the number. So that would increase from 0 to 5.. This way, it actually needed three for loops, and one counter based on what it would count how many space is needed.
Code would look something like:
int counter=0;
firstLoop: for() {
secondLoop:for() {
thirdLoop:for(0->counter){
System.out.print(" ");
}
System.out.print(num);
}
System.out.println();
counter++;
}