1  Integer Arithmetic
Created 3 years ago
Duration 0:06:18
206
Get an introduction to or review of integer arithmetic in Java programming.

Embed

Social
Select the file type you wish to download
Slide Content

Slide 2  Integer Arithmetic

Slide 3  Simple arithmetic
 All four basic arithmetic operations exist in programming languages
 Addition, subtraction, and multiplication all work exactly as expected:

Slide 4  Integer division
 When working with integers, division returns only the whole number part of the result (the quotient):

Slide 5  Modulo (remainder) operator
 Programming also includes a fifth operator, called the modulo operator (%), which returns the remainder of dividing its two operands:

Slide 6  Order of operations
 The usual order of operations of observed with modulo performed along with multiplication and division:
 You can use parentheses to override the normal order of operations:

Slide 7  Check your understanding

Slide 8  Check your understanding

Slide 9  Check your understanding

Slide 10  Check your understanding

Slide 11  Practice #1

Slide 12  Practice #2

Slide 13  Practice #3

Slide 14  Practice #4

Slide 15  Practice #5