Friday 5 September 2014

NPTEL Programming in C - Pythagorean Triples

Three numbers form a Pythagorean triple if the sum of squares of two numbers is equal to the square of the third.

 For example, 3, 5 and 4 form a Pythagorean triple, since 3*3 + 4*4 = 25 = 5*5

You are given three integers, a, b, and c. They need not be given in increasing order. If they form a Pythagorean triple, then print "yes", otherwise, print "no". Please note that the output message is in small letters.

Sample Input
3
5
4

Sample Output
yes

Note : NPTEL follows gcc compiler which doesn't supports conio.h package and it always to be started as int main() and should return a integer value

0 comments:

Post a Comment