Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Display decimal parts in C language
Display decimal parts in C language
1. First, open vc6.0 in the computer, create a new project, and add the stdio.h header file.

2. Then add the math.h header file and add the main function.

3. Then define the number of variables of type double.

4. Then define down and up variables and round them down with floor.

5. Then round with ceil, and finally print the result with printf.

6. Finally run the program and see the results, as shown in the figure below, and it is finished.