Search
 
SCRIPT & CODE EXAMPLE
 

CPP

Sin in c++

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
  double x = 0.439203, result;
  
  result = sin(x);
  cout << "sin(x) = " << result << endl;
  
  double xDegrees = 90.0;
  
  // converting degrees to radians
  x = xDegrees*3.14159/180;
  result = sin(x);
  
  cout << "sin(x) = " << result << endl;

  return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: tuple c++ 
Cpp :: c++ constructors 
Cpp :: use lower bound in pair vector 
Cpp :: how to put bitset into a string in c++ 
Cpp :: What should main() return in C++? 
Cpp :: c++ function as param 
Cpp :: insert vector to end of vector c++ 
Cpp :: how print fload wiht 2 decimal in c++ 
Cpp :: int to string c++ 
Cpp :: Write C++ program to sort an array in ascending order 
Cpp :: c++ random number within range 
Cpp :: cpp initialize multidimensional vector 
Cpp :: segmented sieve cpp 
Cpp :: initialize an array in c++ 
Cpp :: char ascii c++ 
Cpp :: count number of set bits C++ 
Cpp :: min element in stl c++ 
Cpp :: read and write file in c++ 
Cpp :: how to get size of 2d vector in c++ 
Cpp :: declare nullptr c++ 
Cpp :: c++ pi float 
Cpp :: string to upper c++ 
Cpp :: c++ string to int 
Cpp :: c++ program to print natural numbers from 1 to 10 in reverse order using while loop 
Cpp :: bee 1002 solution 
Cpp :: max in c++ 
Cpp :: how to split string into words c++ 
Cpp :: stack implementation through linked list 
Cpp :: zero fill in c++ 
Cpp :: How do I read computer current time in c++ 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =