What will be the resultant type of the following expression if b represents a byte variable, I
represents an int variable, f represents float variable and d represents double variable?
b – i + (int) d / f – i * f + b
Do answer this with complete solution
Answers
Answered by
1
Answer:
Solving According To BODMAS Rule
- (int)d / f = float type
d is in double it will in greatest type
but it convert in int so greatest type is float
- after this the equation is = b - i + f - i * f + b
- i * f = float type
- after this the equation is = b - i + f - f + b
- i + f = float type and f + b = float type
- after this the equation is = b - f - f
- b - f- f = float type
- the answer is float type
so float is the resutant type.
Similar questions
Social Sciences,
17 days ago
Math,
17 days ago
Math,
1 month ago
Social Sciences,
1 month ago
Chemistry,
9 months ago
Math,
9 months ago
Math,
9 months ago