### help me

can some one help me with this, the use has to put in the angle an the opposite
but i dont no how to do the code?
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596`` ``````// Maths Helper #include // define identifier PI with a constant #define PI 3.14159 // define identifier TWO with a constant #define TWO 2.0 using namespace std; char menu() { char choice; cout<< "\nMaths Helper"; cout<< "\n\n**************************************\n"; cout<< "\n\n Please choose one of the following:\n"; cout<< "\n\n 1 - Area of a circle "; cout<< "\n 2 - Circumference of a circle "; cout<< "\n 3 - Factorial of a number "; cout<< "\n 4 - Hypotenuse of a triangle "; cout<< "\n 5 - Exit"; cout<< "\n\n\n**************************************\n"; cout<< "\n\n Enter you choice and press return: "; cin >> choice; return choice; } int main() { int num,factorial=1,Angle, Opposite; float area, radius, circumference; char choice; do { choice = menu(); switch (choice) { case '1': cout << "\n\nArea of a circle" << "\n\nEnter the radius:"; cin >> radius; // area = PI*radius*radius area = PI * radius * radius; // circle area cout << "\nCircle area = " << area << endl; // Pause for user system("pause"); break; case '2': cout<< "\n\nCircumference of a circle" <<"\n\nEnter a circumference of a circle:"; cin>>radius; // circumference = 2*PI*radius circumference = TWO * PI * radius; // circle Circumference cout<<"\nCircumference = "<>num; // a = 1, number less then 1 equals number, increase the number by 1 for(int a=1;a<=num;a++) { // factorial = 1 * factorial=factorial*a; } //Factorial number cout<<"\n\nFactorial number is ="<>Angle; cout<< "\n\n Enter the Opposite:"; cin>>Opposite; system("pause"); break; case '5': cout<< "Exit"; break; default: cout<< "\nNot a valid choice."; } } while (choice != '5'); return 0; } ``````
You mean to find the magnitude of the hypotenuse?

Use the cmath header. There are some useful functions in there.
Then you do something like:

sin x=opposite/hyp
=>hyp=opp/sin x

Aceix.
because im new to this is anyone able to edit my code and put what Acelx has said into it?
Topic archived. No new replies allowed.