Oh wait, now I see why what you're doing is wrong. For A, B, C to form a triangle, it has to be true that A+B>C, A+C>B and B+C>A. In other words, all three have to be true. The reason your program...
Type: Posts; User: Shambolic
Oh wait, now I see why what you're doing is wrong. For A, B, C to form a triangle, it has to be true that A+B>C, A+C>B and B+C>A. In other words, all three have to be true. The reason your program...
You have written
else if(A+C>C)
when you intended
else if(A+C>B)