foo.c: In function 'main':
foo.c:14:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for(int j=1;j<=n;j++)
^
foo.c:14:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
foo.c:16:2: warning: format '%lf' expects argument of type 'double *', but argument 2 has type 'double' [-Wformat=]
scanf("%lf",x[j]);
^
foo.c:18:2: warning: format '%lf' expects argument of type 'double *', but argument 2 has type 'double' [-Wformat=]
scanf("%lf",y[j]);
^
foo.c:21:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for(int i=1;i<=n;i++)
^
foo.c:5:10: warning: variable 'waste' set but not used [-Wunused-but-set-variable]
int n,r,waste;
^