[ create a new paste ] login | about

Link: http://codepad.org/TKSNpwmt    [ raw code | output | fork ]

C, pasted on Oct 6:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>

#define TOP 8

int main(void){
    int i, j;

    for ( i = 1; i < TOP + 1; ++i ){
        for ( j = 0; j < TOP- i; ++j )
            putchar(' ');
        for ( j = 0; j < 1 + 2 * ( i - 1); ++j)
            putchar('*');
        putchar('\n');
    }

    return 0;
}


Output:
1
2
3
4
5
6
7
8
       *
      ***
     *****
    *******
   *********
  ***********
 *************
***************


Create a new paste based on this one


Comments: