Q:

Given the variable definitions in this section, explain what conversions take place in the following expressions

0

 Given the variable definitions in this section, explain what conversions take place in the following expressions:

(a) if (fval)

(b) dval = fval + ival;

(c) dval + ival * cval;

Remember that you may need to consider the associativity of the operators.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

(a) `fval` is converted to `bool`.

(b) `ival` is converted to `float`, then added to `fval`, finally the result is converted to `double`.

(c) `cval` is promoted to `int`, then multiplied by `ival`, then the result is converted to `double`, then added to `dval`.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now