write a c program which uses the ternary operator to print -1, 0 or 1 if the value input to it is negative, zero or positive.
ternary operator ----------------------------------------------
first_exp?second_exp : third_exp;
-----------------------------------------------means----------------
if (first_exp)
x=second_exp;
else
x=third_exp;
-----------------------------------------------------------
i think someone knowing this operator would solve it it seconds.
thanks in advance, i really need it.
2007-03-16
20:46:10
·
3 answers
·
asked by
Amar G
1
in
Computers & Internet
➔ Programming & Design