KnowledgeBoat Logo
|

Computer Applications

Determine the data type of the expression

(2x+3y5w+6z+8p5q)4\Big(\dfrac{2x + 3y}{5w + 6z} + \dfrac{8p}{5q}\Big)^4

if x is int, y is long, w is float, z is double, p is short and q is long double.

Values & Data Types Java

4 Likes

Answer

The result will be of long double data type.

Explanation

(int+longfloat+double+shortlong double)4(longdouble+shortlong double)4(double+long double)4long double\Big(\dfrac{\text{int} + \text{long}}{\text{float} + \text{double}} + \dfrac{\text{short}}{\text{long double}}\Big)^4 \\[1em] \Rightarrow \Big(\dfrac{\text{long}}{\text{double}} + \dfrac{\text{short}}{\text{long double}}\Big)^4 \\[1em] \Rightarrow \Big(\text{double} + \text{long double}\Big)^4 \\[1em] \Rightarrow \text{long double}

Answered By

3 Likes


Related Questions