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