Question: //C++ Pythagorean theorem #include #include using namespace std; int main(int argc, char**argv) { // Choosing a Value to Output cout < < Choose 1 for
//C++ Pythagorean theorem
#include #include using namespace std; int main(int argc, char**argv) {
// Choosing a Value to Output cout << "Choose 1 for A, 2 for B, or 3 for C to calculate: "; int A = 1; int B = 2; int C = 3; // Entering the Value of A, B, and C if (A==1){ cout << " Enter the B Value: " << endl; int B; cin >> B; cout << " Enter the C Value: " << endl ; cin >> C; int C; int A = sqrt(pow(C,2)-pow(B,2)); cout << "The value A is: "; cout >> A ; } else if (B==2){ cout << " Enter the A Value: " << endl ; int A; cin >> A; cout << " Enter the C Value: " << endl ; int C; cin >> C; int B = sqrt(pow(C,2)-pow(A,2)); cout << "The value B is: " cout >> B; } else if (C==3){ cout << " Enter the A Value: " << endl ; int A; cin >> A; cout << " Enter the B Value: " << endl ; int B; cin >> B; int C = sqrt(pow(A,2)+pow(B,2)); cout << "The value C is: " cout >> C; } else { } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
