Task7

mail@pastecode.io avatar
unknown
java
9 days ago
583 B
2
Indexable
Never
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");
        }

    }
}


Leave a Comment