Advertisement
Guest User

Untitled

a guest
May 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7. public static void main(String[] args) {
  8. Scanner scanner = new Scanner(System.in);
  9.  
  10. int n = Integer.parseInt(scanner.nextLine());
  11.  
  12. if (n % 10 == 0) {
  13. System.out.print("The number is divisible by 10");
  14. } else if (n % 3 == 0) {
  15. if(n%6==0){
  16. System.out.print("The number is divisible by 6");
  17. }else {
  18. System.out.print("The number is divisible by 3");
  19. }
  20.  
  21. } else {
  22. System.out.print("Not divisible");
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement