fork download
  1. #include<stdio.h>
  2.  
  3. int main() {
  4. int num, row = 1, i;
  5.  
  6. printf("Enter number of rows : \n");
  7. scanf("%d", &num);
  8.  
  9. for (row = 1 ; row <= 5 ; row++) {
  10. for (i = 1; i <= row; i++) {
  11. printf("* ");
  12. }
  13. printf("\n");
  14. }
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 9432KB
stdin
1
stdout
Enter number of rows : 
* 
* * 
* * * 
* * * * 
* * * * *