WAP to check whether a number is divisible by 7 or not.
2 years ago
OOP Java
Compile code:
class Divisibleby7ornot{
public static void main(String[] args) {
int n=14,r1;
r1=n%7;
if(r1==0)
System.out.println("Number is exactly divisible by 7: "+n);
else
System.out.println("Number is not divisible by 7: "+n);
}
}
Output:
Dipti KC
Jan 8, 2023