# hw1 - Programming Assignment 1 ENGR 3 Summer Session B 2006...

This preview shows pages 1–2. Sign up to view the full content.

Programming Assignment 1 ENGR 3, Summer Session B 2006 Due: Monday August 14, 2006, 5:00 PM. Instructions: Complete the following parts. Turn these programs in using the command: “turnin [email protected] largesmall.c pythagorean.c capacitor.c” Part A (10 points) Write a program that asks you to input integers int1, int2, and int3 and then your program prints out the largest and smallest of these 3 integers. The name of your program must be largesmall.c Part B. (10 points) The Pythagorean theorem says that the sum of the squares of the sides of a right triangle is equal to the square of the hypotenuse. For example, if the two sides of a right triangle are of lengths 3 and 4, then the hypotenuse is of length 5, and we have the equation 3 2 + 4 2 = 5 2 . We then refer to the three integers (3, 4, 5) as a pythagorean triple. Any three integers x, y, and z such that x 2 + y 2 = z 2 are also called a pythagorean triple (x = side1, y = side2, z = hypotenuse). There is a way to produce all such triples. The way is as follows:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

hw1 - Programming Assignment 1 ENGR 3 Summer Session B 2006...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online