#include <stdio.h>intMain () {/*1. The basic use of the arithmetic operator is int a = 10 + 1 + 2-3 + 5; int b =-10; int C = ten * b; int d = 10/2; int e = 10-3; Take the remainder operation (modulo operation)//% on both sides are integers//% the positive and negative results of the remainder are only related to the value of the left side of printf ("%d\n", e); Output value: 1*/ /*//automatic type conversion (double->int) int a = 10.8; Coercion type conversion (double->int) int b = (int) 10.5; printf ("%d\n", a); Output value: Ten*/ //Automatic type lift (int->double) Doublec =10.6+6; printf ("the value of C is%f\n", c); //the value of C is 10.600000 DoubleD =3/2; printf ("The value of D is%f\n", D); //The value of D is 1.000000 DoubleE=10.0/4; printf ("The value of E is%f\n", E); //The value of D is 2.500000 DoubleF= (Double)3/2; printf ("the value of F is%f\n", F); //The value of E is 1.500000 return 0;}
"Good Programmer's note sharing" C-language arithmetic operator