Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language how to calculate division, keep two decimal places. Why is the result of the following program 0.00?
C language how to calculate division, keep two decimal places. Why is the result of the following program 0.00?
The materials to be prepared are: computer and C language compiler.

1. First, open the C language compiler and create a new initialization. A cpp file, such as test.cpp

2. In the test.cpp file, adjust the C language code: double C;; c = 1.0 * a/b; .

3. The compiler runs the test.cpp file, and the division successfully outputs 2-bit integers.