/* File: nested4a.c Revisit nested for loops. */ #include int main() { int rows, row_length ; int i, j ; printf("Enter # of rows: ") ; scanf("%d", &rows) ; printf("Enter length of each row: ") ; scanf("%d", &row_length) ; for (i = 1 ; i <= rows ; i++) { // printf("%2d: ", i) ; for (j = 1 ; j <= row_length ; j++) { if ( j <= i ) { printf(" * ") ; } else { printf(" ") ; } } // print newline at the end of each row printf("\n") ; } return 0 ; }