Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sin_approximation
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
//g++ 5.4.0 #include <iostream> #include <math.h> using namespace std; int main() { cout<< "Enter x \n"; double x; cin >> x; cout<< "Enter eps \n"; double eps; cin >> x; double x1=x; double s=0.; int i=0; int j; int br=0; while (x1 >= eps) { if (i%2==0) s=s+x1; else s=s-x1; i++; j=2*i+1; x1=x1*x*x/j; br++; } cout << "The Result \n" << s; cout << br; }
g++
0.09 0.01
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 0.33 sec, absolute running time: 5.07 sec, cpu time: 6.16 sec, memory peak: 3 Mb, absolute service time: 5,41 sec
edit mode
|
history
|
discussion
Error(s):
Kill signal (SIGKILL)
Enter x Enter eps