fork(1) download
  1. #include<stdio.h>
  2.  
  3. int main() {
  4.  
  5. // Make the initializations
  6. int num = 0; int N; // '0' has to be printed in form of right triangle
  7.  
  8.  
  9. scanf ("%d",&N);
  10.  
  11. for (int i = 0;
  12. i < N;
  13. i++,
  14. ({for (int j = 1;
  15. j <= i;
  16. j++,
  17. putchar('0'));}),
  18. printf("\n"));
  19.  
  20. printf ("Finished pyramid!\n");
  21. return 0;
  22. }
Success #stdin #stdout 0s 3100KB
stdin
4
stdout
0
00
000
0000
Finished pyramid!