-
-
Save oriapp/67028539cf046da23fe9cd913a838dd2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
double long k = 1, | |
s = 0; | |
for (size_t i = 0; i < 1000000; i++) | |
{ | |
if (i % 2 == 0) | |
s += 4/k; | |
else | |
s -= 4/k; | |
k += 2; | |
} | |
printf("[PI] %Lf\n", s); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment