|C Tutorial||Mathematical operators|
Introduction to C language
Type combination and promotion
Floating point types
Int vs float arithmatic
Unary Increment Operators
Pre and Post Variations
C Programming Cleverness and Ego Issues
Other Assignment Operators
C includes the usual binary and unary arithmetic operators. See the appendix for the table
of precedence. Personally, I just use parenthesis liberally to avoid any bugs due to a
misunderstanding of precedence. The operators are sensitive to the type of the operands.
So division (/) with two integer arguments will do integer division. If either argument is
a float, it does floating point division. So (6/4) evaluates to 1 while (6/4.0)
evaluates to 1.5 -- the 6 is promoted to 6.0 before the division.
% Remainder (mod)
Want more information and Video ???