find quotient and remainder in java

 find quotient and remainder


//find quotient and remainder
package com.company;

import java.util.Scanner;

public class Main
{
public static void main(String[] args)
{
int dividend,divisor,quotient,remainder;
Scanner ddqr = new Scanner(System.in);
System.out.print("Enter dividend : ");
dividend= ddqr.nextInt();
System.out.print("Enter divisor : ");
divisor= ddqr.nextInt();
quotient=dividend/divisor;
System.out.println("Quotient is : "+quotient);
remainder=dividend%divisor;
System.out.println("Remainder is : "+remainder);

}
}
output:-
Enter dividend : 15
Enter divisor : 4
Quotient is : 3
Remainder is : 3

Process finished with exit code 0

Comments

Popular posts from this blog

the distance between two cities (in km is input through the keyboard. write a program to convert and print this distance in meter ,feet inches and centimeter.

CREATE UNIT CONVERTER APP

write a program to check whether a triangle is valid or not, when the threeangles of the triangle are entered through the keyboard. A triangle is valid if the sumof all the three angles is equal to 180 degrees