Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language lvalue is an integer variable. The result of the value after various types of mixed operations is a floating point number assigned to the lvalue. What will the result be?
C language lvalue is an integer variable. The result of the value after various types of mixed operations is a floating point number assigned to the lvalue. What will the result be?

This will first calculate b+3.14, the result is a floating point number, and then cast it to int (with decimal places rounded off), which is equivalent to

a=(int)(b +3.14)

As for the output of int and float using %f and %d, it will cause confusion in the number of digits. For specific calculations, you must first look at how floating point numbers are stored in the machine.