Division is one of the four primary arithmetic operations. The operator / (slash) operates on two operands to produce the result.
result = numerator / denominator;
result: variable. Allowed data types: int, float, double, byte, short, long.numerator: variable or constant. Allowed data types: int, float, double, byte, short, long.denominator: non zero variable or constant. Allowed data types: int, float, double, byte, short, long. int a = 50;
int b = 10;
int c = 0;
c = a / b; // the variable 'c' gets a value of 5 after this statement is executed
float a = 55.5;
float b = 6.6;
int c = 0;
c = a / b; // the variable 'c' stores a value of 8 only as opposed to the expected result of 8.409