Quotient and Remainder in Java

0

 Finding the quotient and remainder is one of the most basic problems of mathematics . In this post we are going to see how can we implement this code in java .



The formula for the quotient and remainder is following .

Quotient = Divident / Divisor ;

Remainder = Divident % Divisor ;

Input : Divident  = 10 ; Divisor =  3;

Output : Quotient = 3 , Remainder = 1



public class HindiCodingCommunity
{
    public static void main(String [] args)
    {
        int divident = 10;
        int divisor = 3;

        int quotient = divident/divisor;
        int remainderdivident % divisor;
        System.out.println("Quotient="+quotient);
        System.out.println("Remainder="+remainder);
    }
}


Output : Quotient=3

               Remainder=1



Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !