Task7
unknown
java
2 years ago
583 B
9
Indexable
import java.util.Scanner;
public class TaskSeven {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num1 = sc.nextInt();
if (num1 % 5 == 0 && num1 % 7 == 0) {
System.out.println("Divisible by Both");
} else if (num1 % 5 == 0) {
System.out.println("Invalid: Divisible by 5 Only");
} else if (num1 % 7 == 0) {
System.out.println("Invalid: Divisible by 7 Only");
}
else {
System.out.println("No");
}
}
}
Editor is loading...
Leave a Comment