Java program to find quotient and remainder

  • on April 21, 2020
  • Likes!

Hello Friends! Welcome to the programming shortcut and to we will run java program to find quotient and remainder and compute dividend divisor quotient remainder by this program will help you to make quotient and remainder calculator

Java program to find quotient and remainder

import java.util.Scanner;
public class Qu {
public static void main(String[] args) {
int dividend, divisor, quotient, remainder;
Scanner in = new Scanner(System.in);
System.out.println(“Enter the dividend:”);
dividend = in.nextInt();
System.out.println(“Enter the divisor:”);
divisor = in.nextInt();
if (divisor > 0) {
quotient = dividend / divisor;
remainder = dividend % divisor;
System.out.println(” Divident is : ” + dividend + “\n Divisor is : ” + divisor + “\n Remainder is : ” + remainder + “\n Quotient is: ” + quotient);
} else {
System.out.println(“Divisor is not allow, try Divisor is must greater then Zero”);
}
}
}
Output:
Enter the dividend:
34564
Enter the divisor:
433
Divident is : 34564
Divisor is : 433
Remainder is : 357
Quotient is: 79

I make this programming and hope you are like the post if are you like the post you can please comment and share the post to reach more people.
If any doubt about this Java programming code or input & output please comment below
If you have another question about Java programming send an email by contacting us form is given on the page right side.

Please share your experience about this post,
Thank You!

Article Categories:
Programs in java

Leave a Reply

Your email address will not be published. Required fields are marked *