#include <iostream>
#include <cmath>
using namespace std;
double a, b, c, width, height;
int main()
{
cout << "Enter the width value of the display ratio: ";
cin >> a;
cout << "Enter the height value of the display ratio: ";
cin >> b;
cout << "Enter the diagonal of the display in inches: ";
cin >> c;
width = pow(c, 2) + pow(b, 2);
width = sqrt(width);
height = pow(c, 2) + pow(a, 2);
height = sqrt(height);
cout << "Your TV has a width of " << width << " inches" << " and a
height of " << height << " inches" << endl;
return 0;
}
// I just need a little push in the right direction, the Pythagorean theorem is not working.
Last edited on