Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Numero pi Euler
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//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; }
clang
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.13 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 4 Mb, absolute service time: 0.28 sec
fork mode
|
history
|
discussion
Valor aproximado de pi = 3.141603