/* * test.c * * * Created by Anthony Leto on 2/20/06. * Copyright 2006 __MyCompanyName__. All rights reserved. * */ #include int main() { int lines; int linecounter; int linecounter2; char spacechar; int spacecounter; int spaceend; char astchar; int astcounter; int astend; spacechar = ' '; astchar = '*'; lines = 5; linecounter2 = 1; for(linecounter=1; linecounter<=lines; linecounter++) { switch(linecounter2) { case 1: spaceend = 4; astend = 1; case 2: spaceend = 3; astend = 3; case 3: spaceend = 2; astend = 5; case 4: spaceend = 1; astend = 7; case 5: spaceend = 0; astend = 9; default: printf("Error"); } linecounter2++; spacecounter = 1; for(spacecounter = 1; spacecounter <= spaceend; spacecounter++) { printf(" "); } astcounter = 1; for(astcounter = 1; astcounter <= astend; astcounter++) { printf("*", astchar); } printf("\n"); } return; }