write a Java Program to input a number and check whether it is divisible by 15 or not
Answers
Answered by
1
import java.util.Scanner;
public class Check_Divisiblity
{
public static void main(String[] args)
{
int n;
Scanner s = new Scanner(System.in);
System.out.print("Enter any number:");
n = s.nextInt();
if(n % 15 == 0)
{
System.out.println(n+" is divisible by 15");
}
else
{
System.out.println(n+" is not divisible by 15");
}
}
}
Similar questions