Division and division module


Monday, November 13, 2023 Difficulty: Easy

Objective

Write a program in Java that requests two integers from the user (x, y) and print the result of the division and the rest of the division on a new line.

Instructions

  1. Solicit two integers from the user (x, y).
  2. Perform the division of x by y.
  3. Print the result of the division on a new line.
  4. Calculate the remainder of the division of x by y.
  5. Print the remainder on a new line.

Input

24
5

Output

The division is: 4
The division module is: 4

Solution

Click here to view the exercise solution

Share it

Share it on your social media and challenge your friends to solve programming problems. Together, we can learn and grow.

Copied

The code has been successfully copied to the clipboard.

More Exercises

Continue improving your Java programming skills with our selection of practical exercises from the lesson. Click on Practice and challenge your knowledge!

1

Sums squared

Write a program in Java that requests an integer x from the user and print the result of adding it to the square.

Arithmetic operators

Practice with easy and intermediate Java exercises on arithmetic operations and some types of numerical data.

Practice exercises

Keep learning

C# Programming Course

Free programming course with practical exercises and solutions in C#. Start learning right now!

CookieOwn and third party cookies to improve our services. If you go on surfing, we will consider you accepting its use.