Write a program in java to accept two numbers and display their reminder while the greater number is divided by the smaller number
Answers
Answered by
6
import java.util.*;
public class Reminder
{
public static void main(String args[])
{
Scanner in= new Scanner(System.in);
int a,b,c,d,e;
System.out.println("Enter the two numbers");
a=in.nextInt();
b=in.nextInt();
c=Math.max(a,b);
d=Math.min(a,b);
e=c%d;
System.out.println("Display the reminder"+e);
}
}
Answered by
0
Answer:
public static void main(String[] args)
{
double a = 5, b = 2;
while (a >= b) {
a -= b;
}
System.out.println(a);
}
Similar questions
Accountancy,
6 months ago
Math,
6 months ago
Physics,
11 months ago
English,
1 year ago
English,
1 year ago