← Java from Scratch Lesson 8 of 88 · 5 XP

Warm-up: quotient and remainder warm-up

Theory and problem statement

Machine translation, not yet reviewed by a native speaker.

Integer division / drops the fractional part, and % gives the remainder:

System.out.println(17 / 5);   // 3
System.out.println(17 % 5);   // 2

Task. Read two integers and print, on two lines, the integer quotient and the remainder of dividing the first by the second.

Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.