?
What is the result of the expression 2.5 + 2 in C?
Answer & Solution
Correct Answer:
Option
A
In C, when you add two floating-point numbers, as in the expression 2.5 + 2, the result is a floating-point number. Therefore, the result is 4.5.
Option B (4) is incorrect because it represents an integer result, but the expression involves floating-point numbers.
Option C (2.7) is incorrect; it's not the result of the given expression.
Option D (2) is incorrect for the same reason as Option B; it represents an integer result, not a floating-point result.
Option B (4) is incorrect because it represents an integer result, but the expression involves floating-point numbers.
Option C (2.7) is incorrect; it's not the result of the given expression.
Option D (2) is incorrect for the same reason as Option B; it represents an integer result, not a floating-point result.
Join the Discussion
Login to post a comment or share your explanation.
Login