//Diamond #include #include #define TOTAL_ROWS 15 int main(void){ int row,col,numstars=1,//A[15][15]; int half,rate=1; //Loop through each row for(row=1;row<=TOTAL_ROWS;row++){ half= TOTAL_ROWS/2; } //for(col=1;col<15;col++)A[row][1]=' '; //draw blanks before stars for(col=0;col<=half + 1 -numstars;col++){ printf(" "); } //Draw Stars for(col=1;col<=2*numstars - 1;col++) //if (col=4) // printf("&"); //else printf("*"); //Middle of Diamond if((numstars==(half+1))) rate=-rate; //change numstars by rate numstars=numstars+rate; //New line printf("\n"); system("pause"); return 0; }