programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering OS Languages Paradigms IDEs Build Tools Frameworks Products This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

# Pythagoras theorem code

Greenhorn
Posts: 1
Hello guys, I just wanna code for the following query
The Pythagorean Theorem holds that the length of the hypotenuse (z) of a right triangle with sides x and y is given by the following formula:
x2 + y2 = z 2
As it turns out, there are an infinite number of triangles in which all three of these edge lengths are integers, including the following examples:
3*2 + 4*2 = 5*2
12*2 + 5*2 = 13*2

Rancher
Posts: 42972
73
Welcome to the Ranch.

... and you would like to have code that generates those number triplets? What do you have so far? If you haven't started, what ideas have you had?

lowercase baba
Bartender
Posts: 12565
49
The first steps are always the same. try and figure out how YOU would solve it, with paper and pencil. Don't even consider writing a line of code until you can solve it yourself.