fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int num,i=0,j=0;
  6.  
  7. printf("Enter the num : \n\n");
  8. scanf("%d",&num);
  9.  
  10. if(num<=0)
  11. {
  12. printf("Enter number greater than 0 \n");
  13. }
  14. else
  15. {
  16. for(i=1;i<=num;i++)
  17. {
  18. for(j=1;j<=i;j++)
  19. {
  20. printf("#");
  21. }
  22. printf("\n");
  23. }
  24.  
  25. }
  26.  
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 10304KB
stdin
5
stdout
Enter the num  :  

#
##
###
####
#####