write a program in java to check whether a given number is divisible by another given number
Answers
Answered by
1
import java.util.*;
class Pract
{
public static void Practice()
{
Scanner Promoter = new Scanner(System.in);
System.out.print("Enter the two numbers:");
double a = Promoter.nextDouble();
double b = Promoter.nextDouble();
if( a % b == 0)
System.out.println("Yes.");
else
System.out.println("No.");
}
}
Output:
Enter the two numbers:45
15
Yes.
Similar questions
English,
7 months ago
Science,
7 months ago
English,
7 months ago
World Languages,
1 year ago
English,
1 year ago
Computer Science,
1 year ago
Computer Science,
1 year ago