scanf()
statement needs to use %lld
too.There are far too many parentheses and far too few spaces in the expression
pi += pow(-1.0, e) / (2.0*e + 1.0);
int
for main()
.int main(void)
when it ignores its arguments, though that is less of a categorical statement than the rest.main()
and don't use it myself; I write return 0;
to be explicit.I think the whole algorithm is dubious when written using long long
; the data type probably should be more like long double
(with %Lf
for the scanf()
format, and maybe %19.16Lf
for the printf()
formats.