This commit is contained in:
2025-02-09 09:16:37 +03:00
parent 24d05e18d6
commit 9e90bec9f7
7 changed files with 190 additions and 1 deletions

12
DeitelC/Chapter4/pi.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
int main(void){
float pi = 4.0;
int sign = -1;
for (int i = 3; i < 8092; i += 2) {
pi += sign*(4.0/i);
sign = -sign;
}
printf("%.6f\n",pi);
}