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.

Respuesta :

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 << "\n\nAngle in radian - " << fixed << setprecision(2) << angleRad(angle);

return 0;

}

Explanation: