Oh yeah, good point kesh...Looking at my previous post, I forgot to include a bit about the leading spaces in the output. (My bad, I spotted it when writing my original post, but completely forgot to include it in my description! Very careless of me!)
@OP:
If you look at your desired output, the first line has no leading space, the 2nd has one leading space, the 3rd has two etc.etc. .
So you can see that for each additional line you output, you will need an additional space.
So you start with 0 leading spaces.
Before you use the loop to count down and output the values from n to minimum, you'll need to use another loop to output the required number of spaces.
After outputting each line you'll need to increment the number of spaces.
In light of my glaring omission, I'll give you some pseudo code for the solution! What the hell I'm feeling generous...
In pseudo code, your algorithm should be something like this:
1. Input a number (num) between 1 and 10
(NOTE: Don't forget to do any error checking, prompt user until they enter something valid)
2. Set minimum value to 1
3. Set number of Leading spaces to 0
4. While minimum is <= to num:
Do the following:
(i). if leading spaces > 0: use a loop to output the required number of spaces.
(ii). Using another loop, count down from num to minimum, outputting each value.
(iii). output a newline character
(iv). increase the minimum value
(v). increase the number of leading spaces.
And that is it!
Cheers for now,
Jas.