/** * stars - print out some fun triangle-like structures composed of stars. */ // +---------+-------------------------------------------------------- // | Headers | // +---------+ #include // +------+----------------------------------------------------------- // | Main | // +------+ int main (int argc, char *argv[]) { char spaces[] = " "; char stars[] = "***********"; int width = 6; int i; for (i = 1; i <= width; i++) { stars[i] = '\0'; printf ("%s\n", stars); stars[i] = '*'; } for (i = 1; i <= width; i++) { spaces[width-i] = '\0'; stars[i] = '\0'; printf ("%s%s\n", spaces, stars); spaces[width-i] = ' '; stars[i] = '*'; } return 0; } // main