/* Program: tree2.c Using nested for loops to draw another tree. */ #include #include "genlib.h" #include "simpio.h" main() { int i, j, k ; for (k = 5 ; k <= 15; k = k + 5) { for (i = 1 ; i <= k ; ++i ) { for (j = 1 ; j <= 15 - k; j++) { printf(" ") ; } for (j = 1 ; j <= k +i ; ++j) { if ( i > k - j) { printf("*") ; } else { printf(" ") ; } } printf("\n") ; } } }