fork download
  1. #include <stdio.h>
  2.  
  3. #define TOTAL_ROWS 10
  4. int main() {
  5.  
  6. int row, col, numstars;
  7. int rate = 1;
  8.  
  9. // Loop through each row.
  10. for (row=1; row<=TOTAL_ROWS; row++) {
  11.  
  12. numstars = row;
  13.  
  14. // Print out the correct number of stars.
  15. for (col=1; col<=numstars; col++)
  16. printf("*");
  17.  
  18. // Go to the new line.
  19. printf("\n");
  20. }
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
*
**
***
****
*****
******
*******
********
*********
**********