Please explain why you think you code will ever have both "Rec_area>Tri_area" and "Rec_area<Tri_area" true.

NOTE: Nesting the second if inside the first is wrong. You likely need an else if instead of the second if.

Edit: Add link If Statements in C - Cprogramming.com

Tim S.