Tuesday, January 10, 2012

What is the value of 6/4.0?

For this operation, one operand is a real type and the other operand is an integer type. When this occurs, C converts the integer to a real type temporarily (meaning that 6 is converted to 6.0) then performs the operation and the result is a real type. Thus, 6/4.0 gives the result 1.5.

No comments:

Post a Comment