i'm not going to solve this for you.
post what you have so far and i can tell you what to change and what your problems are. but i won't just give you the code
Whenever I program a problem, I always look for patterns.
In this particular problem:
You see that the width of the square is 7 when you enter 4. Therefore, we can come up with the equation 2n-1=width.
Next you see that the width is decreasing by 2s. 7 1s to 5 2s to 3 3s and so on. Therefore, we can come up with the for loop:
for(i=0;i<=width;i++) //Where width is 2n-1
And we can continue this with our other equation, width-2=new width of next number.
for(i=0;i<=width-new;i++) //Where new is =0 and then after every loop, n=n+2
We know the middle of the loop, where n will be placed is with the equation: n=middle because for example, you will have 1s,then 2s, then 3s, then 4s. So 4=4. After this middle, the loop can re-loop the others backward and finish. This is where the tricky part comes in. I am also a noob too ;).
So keep searching for patterns and good luck. I will also program this too for a good practice.
[edit]12.18.12: Almost done completing the code...[/edit]
i can chang the rows with 1 for loop
also with another i can print for example : 1233 -> this the third row of my example but i cant print numbers after second 3 -> 321 , for doing this i will need another loop
@ Soorena: Your code compiles but doesn't work. The program glitches out when I enter 13 and when I entered 9, it stopped working completely. I am fixing my code so it wont have gotos and viruses.
@TheIdeasMan: Yeah, caught that didn't you. Don't worry, fixed my libraries, now fixing my code. Will make you proud!
usandfriends : My code are tested with all 13 input;and i dont see any problem!!
my compiler cant compile your libraries in code that you written before!