In this java program, you will learn how to compute quotients and remainder from the given dividend and divisor in Java.

```
//Java Program to Compute Quotient and Remainder
public class JavaPrograms {
public static void main(String[] args) {
int dividend = 222, divisor = 4;
int quotient = dividend / divisor;
int remainder = dividend % divisor;
System.out.println("Quotient = " + quotient);
System.out.println("Remainder = " + remainder);
}
}
```

Quotient = 55

Remainder = 2

- In the above java program, we have created two variables:
and`dividend`

. Here, we are calculating the quotient and remainder by dividing`divisor`

**222**by**4**. - To find the quotient, we have used the / operator. We have divided
**dividend (222)**by**divisor (4)**. Since both dividend and divisor are integers, the output will also be integers. **222 / 4 // results 55.5****// convert 55.5 to integer****// output will be 55**- Likewise, to find the
**remainder**we use the mod(**%**) operator. Here, the**dividend**is divided by the**divisor**, and the**remainder**is returned by the mod(**%)**operator. **222 % 4 // results 2**- Finally,
**quotient**and**remainder**are printed on the screen using

function.**println()**

## Comments