Print Page Print Page

CH3 – Modulus Operator

  1. Open DrJava and expand the Interactions pane.  Add the following code interactively to the pane.
> int quotient = 76/12;
> int remainder = 76%12;
> quotient
6
> remainder
4
> double remainder = 76%12;
> remainder
4.0
>