fork download
  1. //Q47. Write a program to print the following pattern:
  2. //*
  3. //**
  4. //***
  5. //****
  6. //*****
  7. #include <stdio.h>
  8.  
  9. int main() {
  10. int i, j;
  11. for (i = 1; i <= 5; i++) {
  12. for (j = 1; j <= i; j++) {
  13. printf("*");
  14. }
  15. printf("\n");
  16. }
  17. return 0;
  18. }
  19.  
  20.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
*
**
***
****
*****