Dremendo Tag Line

Print remainder of a division in Java

Java Output - Question 11

In this question, we will see how to print remainder of a division in java programming using the java output. To know more about java output click on the java output lesson.

Q11) Write a program in java to find the remainder by dividing int a=5 by int b=2.


public class Q11
    public static void main(String args[])
        int a=5,b=2;
        System.out.println("Remainder = " + (a%b));


Remainder = 1