Q. Which of the following will be the type of ‘res’?
Code:
res = (float)x * (int)y / (long)w * (double)z
β
Correct Answer: (A)
double
Explanation: If both operands are “int” or “char”, the result is “int”. If both are “float” or “doubles”, the result is “double”.