asked 167k views
0 votes
Write a program that generate a one digit Random number that represent angle in degree. Then convert it into Radians using the following formula and display the results with two digit after the decimal point.

asked
User Alfi
by
8.3k points

1 Answer

6 votes

Answer:

#include <iostream>

#include<iomanip>

#include<ctime>

using namespace std;

double angleRad(double a)

{

a *= 0.0175;

return a;

}

int main()

{

srand(time(0));

double angle = rand() % 10;

cout << "Angle in degrees - " << angle;

cout << "\\\\Angle in radian - " << fixed << setprecision(2) << angleRad(angle);

return 0;

}

Step-by-step explanation:

answered
User Isaac Minogue
by
8.9k points

No related questions found