Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Six Trigonometric Functions
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
// Six Trigonometric Equations #include <iostream> #include <cmath> using namespace std; const double pi = 3.14159; const char newline = '\n'; int main () { double x=-5; double y=-2; double r=sqrt((x*x)+(y*y)); cout << "sin = "; cout << y; cout << "/"; cout << r; cout << newline; cout << "cos = "; cout << x; cout << "/"; cout << r; cout << newline; cout << "tan = "; cout << y; cout << "/"; cout << x; cout << newline; cout << "sec = "; cout << r; cout << "/"; cout << x; cout << newline; cout << "csc = "; cout << r; cout << "/"; cout << y; cout << newline; cout << "cot = "; cout << x; cout << "/"; cout << y; }
g++
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.52 sec, absolute running time: 0.15 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0.68 sec
fork mode
|
history
|
discussion
sin = -2/5.38516 cos = -5/5.38516 tan = -2/-5 sec = 5.38516/-5 csc = 5.38516/-2 cot = -5/-2