Write a java program to input a no and check whether the no divisible by 7 or not.
Answers
Answered by
1
This program is compiled and executed through BlueJ.
Attachments:
Answered by
0
package Brainly_Answers;
import java.util.Scanner;
class test
{
public static void main (String[]args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter number: ");
double n = sc.nextDouble();
if (n%7==0) {
System.out.println("Number is divisible by 7. ");
}
else {
System.out.println("Number is not divisible by 7. ");
}
}
}
Similar questions