The Pythagorean theorem states that the sum of the squares of the sides of a right triangle is equal to the square of the hypotenuse. For example, if two sides of a right triangle have lengths 3 and 4, then the hypotenuse must have a length of 5. The integers 3, 4, and 5 together form a Pythagorean triple. There is an infinite number of such triples. Given two positive integers, m and n, where mn, a Pythagorean triple can be generated by the following formulas:
side1 = m2 - n2
side2 = 2mn
hypotenuse = ![]()
Write a program that reads in values for m and n and prints the values of the Pythagorean triple generated by the formulas above.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.