2.3 Code Practice: Question 1
Write a program that prompts the user to input two numbers—a numerator and a divisor. Your program should then divide the numerator by the divisor, and display the quotient and remainder without decimals.
Answers
Answered by
0
Answer:
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter 1st number : ");
int a=sc.nextInt();
System.out.println("Enter 2nd number : ");
int b=sc.nextInt();
int c,d;
c=a/b;
d=a%b;
System.out.println("Dividing "+a+" with "+b+" gives quotient "+c+" and remainder "+d);
}
}
Explanation:
it is a java program
Attachments:
Similar questions