Update ternary.c