how to find that a triangle is valid or not in c