Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language, I want to carry out remainder operation, but I entered a decimal. How to change decimals into integers without decimals?
C language, I want to carry out remainder operation, but I entered a decimal. How to change decimals into integers without decimals?
For example, data has two decimal places. You can use the following two methods:

Floating point number x= 123.45

1)int y = x * 100;

y % = 7;

2)int y =(int)(x * 100)% 7;