Java Program to Calculate Quotient and Remainder
In this example, we are giving a program to calculate quotient and remainder.
To calculate quotient and remainder:
# To calculate quotient and remainderpublic class QuotientRemainder {public static void main(String[] args) {int dividend = 25,int divisor = 4;int quotient = dividend / divisor;int remainder = dividend % divisor;System.out.println("Quotient = " + quotient);System.out.println("Remainder = " + remainder);}}
Output:
Quotient = 6 Remainder = 1