Write a java program to find out division and quotient of two numbers with input method.
Answers
....
Input: Enter the first number: 6
Enter the second number: 2
Output:
The quotient of 6 and 2 is 3
The remainder of 6 and 2 is 0
//Java Program to find the quotient and remainder
public class Main
{
public static void main(String[] args)
{
int num1 = 19, num2 = 4; //Declare and initialize the numbers
System.out.println("The entered number is: "+num1);
System.out.println("The entered number is: "+num1);
int quotient = num1 / num2; //Find quotient
int remainder = num1 % num2; //Find Remainnder
System.out.println("After division the quotient and remainder are: ");
//Print the quotient and remainder
System.out.println("The quotient is: " + quotient);
System.out.println("The remainder is: " + remainder);
}
}
Answer: