Problem Link: CodeChef: Practical coding for everyone
Learning course: Learn Java
My code
class CodeChef
{
public static void main(String args[])
{
int a=15;
int b=35;
if(a%7==0 && b%7==0)
{
if(a%5==0 && b%5==0)
{
System.out.println("The number is divisible by both 5 & 7");
}
}
if(a%7!=0 && b%7!=0){
if(a%5!=0 && b%5!=0)
{
System.out.println("The number is not divisible by both 5 & 7");
}
}
}
}