Hi all,
Now, I'm trying practice on c++ basics, since few minutes I tried practice "library functions" especially "sin" function, I wrote this trivial program to calculate angle in console screen, but when I input 90 degree it gave me 0.8939, but with calculator it gave me 1, why console can not gave my integer answer like calculator..?
This is my code:
//calculate sin angle | library functions
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double angle, answer;
cout << "Enter Angle: ";
cin >> angle;
answer = sin(angle);
cout << "sin " << angle << " is = " << answer << endl;
return 0;
}