The operators in the C language for basic arithmetic operations are: +,-,*,%,/. The use of these operators is essentially the same as you might imagine:
The addition operator "+" causes the values on both sides of it to be added together.
The subtraction operator "-" subtracts the subsequent number from the number preceding it.
Multiplication is represented by "*" . The C language does not have a function to calculate squares, and there is no exponential operator. But you can use multiplication to calculate the square.
the symbol "%" means redundancy. The result of the remainder operation is the remainder after dividing two numbers. Therefore, the value of the participating operation must be an integer.
the symbol "/" denotes division. Note that the division operation of a floating-point type gets a floating-point number result, and the integer division operation gets an integer result.
For example, 5/2 results are 2. When you mix integers and floating-point numbers, the result is a floating-point number, such as the 5/2.0 result is 2.5.
Let's see an example:
#include <stdio.h> int main (void) { int7; int 3 ; // divide a by the remainder of B and output the remainder // write down your code here. printf ("%d", a%b); return 0 ; }
The result? More learning content, just in the code bud Net Http://www.mayacoder.com/lesson/index
C Language Basic Learning operator-Basic arithmetic operator