Sin is not giving the correct value

256 Views Asked by At
#include <iostream>
#include <cmath>

Using namespace std;

void main ()
{
   double z,a;
   cout <<"input a"<<endl;
   cin>>a;

   z=sin (a);

   cout <<"z="<<z <<endl;

   system("pause");
}

When I input the variable a with value of 90 it gives me 0.893997 And when I make the variables int or float it gives the same value

1

There are 1 best solutions below

0
On

The input of 'sin' is in radians (http://en.cppreference.com/w/cpp/numeric/math/sin)

So the answer is, in fact , correct