We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

when you use "WHEN A != B OR B != C OR A != C THEN 'Scalene'" why do you use "OR"? shouldn't it be "AND" because ALL 3 sides are not equal? so it will be "WHEN A != B AND B != C THEN 'Scalene'".

Yes you are right AND should be used instead of OR, but even if you use OR then the test case is been submitted..., how is this possible, or there is a fault in the question?

## Type of Triangle

You are viewing a single comment's thread. Return to all comments →

when you use "WHEN A != B OR B != C OR A != C THEN 'Scalene'" why do you use "OR"? shouldn't it be "AND" because ALL 3 sides are not equal? so it will be "WHEN A != B AND B != C THEN 'Scalene'".

WHEN A = B AND B = C THEN 'Equilateral' WHEN A = B OR B = C OR A = C THEN 'Isosceles' ELSE 'Scalene'

Why does not A = B = C work for Equilateral? Whats the difference between A = B and B = C?

when A=B=C execute then if A=B then it return boolean value if true then 1 else 0 then it compare 1=c

e.g. (10,10,10)

when execute A=B=C then (10=10)=10 take as (10=10) return 1 because its true then in next stape it compare 1=10 in next step and return false

This explanation is not true. counter example: ((A=B)=(B=C)) doesnt work. step 1: ((A=B)=(B=C)) -> (1) = (B=C) step 2: ((1) = (B=C)) -> (1) = (1) step 3: (1) = (1) -> 1 But doesnt work

this is simple math logic if A=B and B=C it means A=C....

operator overlosding dont work here

Yes you are right AND should be used instead of OR, but even if you use OR then the test case is been submitted..., how is this possible, or there is a fault in the question?