Hey
I wanted to know how to make a number pyramid with (for example) the following formation:
(This would be for 5 rows, with 5 being a variable and as you can see in the last row the last number is 5 on each end)
[IMG]http://img199.imageshack.us/img199/2239/numbers.png[/IMG]
http://img199.imageshack.us/img199/2239/numbers.png
So far I have this:
int j,i,n;
n=5; //Example
for (i=1;i<=n-1;i++)
{
printf ("%i",i);
for (j=i;j<n;j++)
{
printf ("/n");
}
}
But I seem to be stuck..........I have a feeling another loop is required but I just dont seem to know how to place it correctly.
Thanks for any help :)