Unformatted text preview: triangle is equal to the square of its hypotenuse. For example, 3 , 4 and 5 are the sides of a right angle triangle as they form a Pythagorean Triple ( 5 2 = 4 2 +3 2 ). Given 2 numbers, m and n where m ≥ n , a Pythagorean Triple can be generated by the following formulae: a = m 2n 2 b = 2 × m × n c = p a 2 + b 2 Write an algorithm that reads in values for m and n and prints the values of the Pythagorean Triple generated by the formulae above. Exercise 15 Write an algorithm that reads the amount of time in seconds and then displays the equivalent hours, minutes and seconds. Note: You can use the function INT(x/y) that gives the integer part of the result of the division x/y . For example INT(5/2)=2 . 1...
View
Full
Document
This note was uploaded on 12/22/2009 for the course CSEN 102 taught by Professor Slim during the Spring '09 term at German University in Cairo.
 Spring '09
 Slim

Click to edit the document details