- Related Questions & Answers
- C++ Program to Find Quotient and Remainder
- Java program to compute Remainder and Quotient
- C Program to Compute Quotient and Remainder?
- C++ Program for quotient and remainder of big number
- Python Program to Read Two Numbers and Print Their Quotient and Remainder
- remainder() in C++ program
- Program to find remainder without using modulo or % operator in C++
- C# program to accept two integers and return the remainder
- Program to find remainder when large number is divided by 11 in C++
- Program to find remainder when large number is divided by r in C++
- remainder() in C++
- Modulo / Remainder in Arduino
- How to perform integer division and get the remainder in JavaScript?
- Java program to check for prime and find next Prime in Java
- Java program to find missing and additional values in two lists

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

To find quotient and remainder in Java, the code is as follows −

public class Demo{ public static void main(String[] args){ int my_dividend = 11, my_divisor = 7; int my_quotient = my_dividend / my_divisor; int my_remainder = my_dividend % my_divisor; System.out.println("The value of computed quotient is = " + my_quotient); System.out.println("The value of computed remainder is = " + my_remainder); } }

The value of computed quotient is = 1 The value of computed remainder is = 4

A class named Demo contains the main function, where the dividend and divisor values are defined. The quotient and the remainder are found by using the ‘/’ operator and the ‘%’ modulus operator respectively. The values are assigned to different variables and the results are displayed on the console.

Advertisements