Loops/For

Revision as of 14:04, 11 April 2008 by rosettacode>Marshmallows (New page: {{task}}Specifically print out the following pattern by using one for loop nested in another: <pre>* ** *** **** *****</pre> =={{header|C}}== for(i = 1; i <= 5; i++) { for(j = 1; j <= i; ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Specifically print out the following pattern by using one for loop nested in another:

Task
Loops/For
You are encouraged to solve this task according to the task description, using any language you may know.
*
**
***
****
*****

C

for(i = 1; i <= 5; i++) { for(j = 1; j <= i; j++) putchar('*'); puts(""); }