Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Numero pi
//Title of this code //clang 3.6.0 #include <stdio.h> #include <math.h> int main(void) { double pi=0; int i, den=1; // i=1..99 // 2*i-1= 1,3,5,7,9... for (i=1; i<100; i++) //pi = pi + pow(-1, i+1)*4/(2*i-1); { pi = pi + pow(-1, i+1)*4/den; den+=2; } printf("\n\nValor aproximado de pi = %lf", pi); return 0; }
run
|
edit
|
history
|
help
0
Cvičenie -č.6-UDP
Herout (67) - 3
13 12 2014 20:25
Herout (67) - 14
C - Append Character to String
Paso parámetros a punteros
Herout (67) - 8
Bucles: suma impares menores que N
CV09-2
Punteros: strcpy