Examveda
Examveda

What is the result of the expression 2.5 + 2 in C?

A. 4.5

B. 4

C. 2.7

D. 2

Answer: Option A

Solution(By Examveda Team)

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.

This Question Belongs to C Program >> Operators And Expressions

Join The Discussion

Related Questions on Operators and Expressions