This program prompts the user to enter an angle in radians and converts it into degrees.
Source Code:
Output:
Source Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <iostream.h> #include <conio.h> const int cDegreeFactor = 57.295779; int main() { cout << " Enter the angle in radians: "; double radians; cin >> radians; double degrees = radians * cDegreeFactor; cout << " " <<radians << " Radians is " << degrees << " Degrees\n"; getch (); return 0; }// main |
Output:
Enter the angle in radians: 1.578947 1.578947 Radians is 90 Degrees
No comments:
Post a Comment