fork download
  1. #include<stdio.h>
  2. int main ()
  3. {
  4. int rows,a,b,space;
  5. printf("Enter a number of rows:");
  6. scanf("%d",&rows);
  7. space=rows-1;
  8. for(b=space;b>=1;b--)
  9. {
  10. for(a=rows;a>=1;a--)
  11. space--;
  12. printf("");
  13. for(a=2*(rows-b)-1;a>=1;a--)
  14. printf("*",a);
  15. printf("\n");
  16. space = space-1;
  17. }
  18. getch();
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:12:16: warning: zero-length gnu_printf format string [-Wformat-zero-length]
         printf("");
                ^
prog.c:14:20: warning: too many arguments for format [-Wformat-extra-args]
             printf("*",a);
                    ^
prog.c:18:5: warning: implicit declaration of function 'getch' [-Wimplicit-function-declaration]
     getch();
     ^
/home/j96Hzq/ccdUBg1x.o: In function `main':
prog.c:(.text.startup+0x7e): undefined reference to `getch'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty