Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language problem, can int be a decimal such as int x=4.6? No, as long as it is a decimal, it should be float or D.
C language problem, can int be a decimal such as int x=4.6? No, as long as it is a decimal, it should be float or D.
Yes, but the data 4.6 will become 4. According to the requirement of data type integer, 4.6 will be truncated and read as 4, which is ok, but meaningless. Generally speaking, int is used for integers, float and double are used for decimals. I hope my answer is helpful to you! Hope to adopt!