A PYTHAGOREAN PROBLEM AS A PROGRAMMIN G EXERCIS E David E . Gibso n Pepperdine Universit y Malibu, California 9026 3 Introductio n Several years ago, I was working wit h some students who had done a bit of wor k in Pascal and were returning to sharpe n and extend their skills . I needed a programming problem that would help the m remember the Pascal they had forgotten an d prepare them for more advanced work . Th e problem I posed was one that intrigue d several of the students and me, and I hav e returned to the problem several times ove r the years . I find the problem interestin g because, though it is a simple problem, i t illustrates a number of the capabilitie s of Pascal and also raises some interestin g issues in programming . The problem is quite simple . In it s original form, students were asked to fin d triples of integers that satisfy the Py thagorean right triangle relation . I asked the students to print triples o f numbers such that a 2 + b2 = c 2 , where a, b , and
/lp/association-for-computing-machinery/a-pythagorean-problem-as-a-programming-exercise-PVPtUQ6Krn