Pythagorean triple with loops

5 views (last 30 days)
RAJKIRAN ADDLA NARASIMHARAJU
Pythagorean triple consists of three positive integers 'a', 'b', and 'c', such that a^2 + b^2 = c^2.
For b=2020, find matching integers 'a' and 'c' and, as a confirmation of the successful solution found, enter into the answer filed the value of the 'a' only (where 'a' can be smaller or lager than 'b'). The task has several solutions (i.e. "a and c" pairs),
find the solution with smallest valuue of a?
how do you write the script for the above problem ?
  1 Comment
Sriram Tadavarty
Sriram Tadavarty on 5 Apr 2020
Seems like an homework problem. Please do show us your attempt and indicate where you struck. For an attempt to the solution, here is a question which is answered previously.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!