Task7
Anonymous
java
06/09/2024 10:37 AM
780 B
18
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