Computer Science, asked by manishashukla1211, 1 month ago

write a program in java to accept a number and display whether the number is divisible by 7 or not ​

Answers

Answered by atrs7391
0

package My_Program;

import java.util.Scanner;

public class test {

   public static void main(String[] args) {

       Scanner sc = new Scanner(System.in);

       System.out.println("Enter Number: ");

       double num = sc.nextDouble();

       if(num % 7 == 0) {

           System.out.println("Given Number is Divisible by 7. ");

       }

       else {

           System.out.println("Given Number is not Divisible by 7. ");

       }

   }

}

Similar questions