Skip to main content

Math Operators

// Addition
a + b;

// Subtraction
a – b;

// Multiplication
a * b;

// Division & Floor Division
a / b; // If both are Integers, result will be a Integer
a / b * 1.0; // If you want an float result, you can multiply one of them to 1.0
(float) a / b; // Or, you can also use a simple type cast

// Exponent
// Not Available
// Use math.h library

// Modulus
a % b; // It returns the "remainder" after the division (modulo division)