fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int row, c, n=3;
  5.  
  6.  
  7. for (row = 1; row <= n; row++) // Loop to print rows
  8. {
  9. for (c = 1; c <= 2*row-1; c++) // Loop to print stars in a row
  10. printf("*");
  11.  
  12. printf("\n");
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 4572KB
stdin
Standard input is empty
stdout
*
***
*****