Computer Science, asked by lakhwinderkaur3, 1 year ago

write a program in java to check whether a given number is divisible by another given number

Answers

Answered by BrainlyPromoter
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