Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language is more professional.
C language is more professional.
Write a program that defines five integers and initializes them to: 1, 10, 100, 1000 and 10000. Then use plastic (%d) to output them as a line, and separate each number with a space. Then use floating point on the second line.

I remember that I can't output integers with% f. Students who have studied the principle of computer composition will know that cpu stores and processes floating-point numbers and integers in different ways. Floating-point number consists of three parts, S (one bit binary) is the sign bit, E (eight bit binary) is the sequence code, M(23 bit binary) is the mantissa, and the integer belongs to the fixed point and is directly used in cpu registers.

(-1) ~ s * (1.m) * 2 ~ (E- 127), that is, the power of (s-1× 1.m× 2 (e-/kloc As you can see, you can't use% f to directly output the number of% d, which will cause link errors.

If necessary, you can print f("%f ",f = d); Where f is a floating point number and d is an integer, so that the number of% d can be used as a compromise output.