Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, the order of multiplication and division is different, why are the results different?
In C language, the order of multiplication and division is different, why are the results different?

Hello, I am happy to answer your question.

In C language, variables are strictly defined and must be defined first and then used.

In Figure 1, F is an integer, so because 9/5 has brackets, it will be calculated first.

Because F is an integer, the result of 9/5 here is 1, then F=C*(9/5)+32=5*1+32=37

In Figure 2, F=C* 9/5+32=5*9/5+32=9+32=41.