What's wrong with my method?

#include <stdio.h>
#include <stdlib.h>
int main()
{
int first,i=0,a=1;
double end=0,end2;
printf(“How many π values do you want?”);
scanf("%d",&first);
for(i;i<=first;i++);
{
end=end+(1/a)-(1/(a+2));
a=a+4;
}
end2=end*4;
printf("%lf",end2);
return 0;
}

Can you provide some context?
Put the link of the problem and format your code .
This may help you

1 Like

completely random, but try i<first and not <= first, loops usually run in the first way

Thank you for giving this advice.Thanks a lot.