Java program to check whether a number is divisible by 5 and 11 or not













Java program to check whether a number is divisible by 5 and 11 or not

Java Tutorial Java Exercises Data Structures











Java program to check whether a number is divisible by 5 and 11 or not


/** * Java program to check whether a number is divisible by 5 and 11 or not */ import java.util.Scanner; class Test { public static void main(String[] args) { int n; Scanner p=new Scanner(System.in); System.out.print("Enter any value : "); n=p.nextInt(); if(n%5==0&&n%11==0) { System.out.println(n+" Is Divisiable by 5 and 11"); } else { System.out.println(n+" Is Not divisiable by 5 and 11"); } } }




Output:

Enter any value : 10 10 Is Not divisiable by 5 and 11 Enter any value : 55 55 Is Divisiable by 5 and 11