write a program in java to accept a number and display whether the number is divisible by 7 or not
Answers
Answered by
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