Here is something that I can't figure out... How can I make a program that prints a
Number triangle with height = b
Example: b=5
Output is
55555
4444
333
22
1
?? Thanks in advance! :)
Printable View
Here is something that I can't figure out... How can I make a program that prints a
Number triangle with height = b
Example: b=5
Output is
55555
4444
333
22
1
?? Thanks in advance! :)
What have you tried?
Why would you start with a low number if your output is supposed to start with a high number? It's almost as if you don't know how to count backwards. Try Googling "how do I count backwards".
Quzah.
Backwards is sort of a key word here. How do you get from 5 to 4? From 4 to 3? Etc.?
Good lord.... try this....
Like the guys said... count BACKWARDS....Code:#include <stdio.h>
int main (void)
{ int row, col;
for( row = 9; row > 0; row--)
{ for (col = row; col > 0; col--)
printf("%d",row);
printf("\n"); }
return 0; }