/* * CISC 105 * 06.13.05 * In-class example of using a while loop to print * out a square of asterisks. * starbox.c */ #include #define NUM_ROWS 10 int main() { int i=0; // Could use the power function: pow( NUM_ROWS, 2 ); while( i< NUM_ROWS * NUM_ROWS ) { if( i % NUM_ROWS == 0 ) { printf("\n"); } printf("*"); i++; } printf("\n"); }