This program prompts the user to enter the lenghts of each of the 3 sides of a triangle. The program outputs the 3 lengths with EQUILATERAL(if all the 3 sides are equal), ISOSCELES(if any 2 sides are equal), SCALENE(if all the sides are different) and NOT a triangle(if the longest side is greater than the sum of the other 2 sides)
I have figured out the if statements for all except for the final case where the program prints"NOT a triangle". Any ideas to the solution of this is most welcome. Assume the variables are x, y and z. for e.g, for the first case where the program prints "EQUILATERAL" ,
the if statement is as follows:
if(x==y&&y==z&&x==z)....
2006-07-16
16:00:14
·
3 answers
·
asked by
jdegbor
1
in
Computers & Internet
➔ Programming & Design