Problem 1:
0 + 1 + 0.5 =
1.5
(3 == 3) && (2 > 4) || (! (2 != 2)) =
TRUE && FALSE || (! FALSE) =
TRUE && FALSE || TRUE =
FALSE || TRUE =
TRUE
It is ok to use 1 for TRUE and 0 for FALSE.
Problem 2:
float a, b, c, r1;
r1 = (- b + sqrt ( b * b - 4.0 * a * c )) / (2.0 * a);
Problem 3: Here is the complete program (without comments though)