fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i;
  5. clrscr();
  6. float n=500,c=1;
  7. float ans=0;
  8. float fans=0;
  9. for(i=1; i<=n; i++) {
  10. if(i==1) {
  11. ans = ans + c/n;
  12. fans+=ans;
  13. }
  14. else {
  15. ans = ans + (c/n)*2;
  16. fans+=ans;
  17. }
  18. printf("%d. %f\n",i,ans);
  19. }
  20. printf("%f",fans);
  21. return 0;
  22. }
  23.  
Compilation error #stdin compilation error #stdout 0s 2168KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:5:2: warning: implicit declaration of function 'clrscr' [-Wimplicit-function-declaration]
  clrscr();
  ^
/home/f00xhg/cchCX5ci.o: In function `main':
prog.c:(.text.startup+0x1e): undefined reference to `clrscr'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty