fork download
  1. //Q48. Write a program to print the following pattern:
  2. //1
  3. //12
  4. //123
  5. //1234
  6. //12345
  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("%d", j);
  14. }
  15. printf("\n");
  16. }
  17. return 0;
  18. }
  19.  
  20.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
1
12
123
1234
12345