Skip to content

Latest commit

 

History

History
25 lines (13 loc) · 539 Bytes

6.md

File metadata and controls

25 lines (13 loc) · 539 Bytes

Math operators

So far you've learned about: intlongdoubleString and char.

Now, you can use math operators shown as below to play with these values.

+, -, *, /, %, ++, --, +=, -=, ...

Pattern

An operation between whole numbers returns a whole number.

An operation between decimals will always perserve the decimal.

Think about that why do we care about the remainder ?

It's very useful if you want to identify odd or even numbers.

int remainder = 10 % 2; // 0

See you in workbook 2.3