theopfor
In Runtime
- Messages
- 173
- Location
- Right behind you
I decided to write my very first USEFUL C++ program. I am trying to convert an angle to a radian. When I put 180 into the program when it prompts for an angle I put in 180 because it should shoot right out pi but instead is puts out 3.
Please note that I am only a begginer where I only know cout, endl, cin, functions, int, and comments.
Code:
#include <iostream>
using namespace std;
int main()
{
cout << "Insert angle please: ";
int angle=567;
cin>>angle;
angle=angle*3.1415926535897932384626433832795/180; //this will make the angle a radian but it has trouble
cout<<"The radians are: "<<angle<<endl;
return 0;
}
Please note that I am only a begginer where I only know cout, endl, cin, functions, int, and comments.