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!
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?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
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.
Hope is the first step on the road to disappointment.
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; }