Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- if (n % 10 == 0) {
- System.out.print("The number is divisible by 10");
- } else if (n % 3 == 0) {
- if(n%6==0){
- System.out.print("The number is divisible by 6");
- }else {
- System.out.print("The number is divisible by 3");
- }
- } else {
- System.out.print("Not divisible");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement