Created
August 19, 2021 08:29
-
-
Save mherman22/c7c7cb0d9ae33f04be0e8d5668fca07d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package myJourney; | |
import java.util.Scanner; | |
public class NumberElement { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
System.out.print("Enter a Number : "); | |
int number = scanner.nextInt(); | |
if (number % 5 == 0 && number % 3 == 0) { | |
System.out.println(number + " is divisible by both 5 and 3 "); | |
}else if (number % 3 == 0) { | |
System.out.println(number + " is divisible by 4"); | |
}else if (number % 5 == 0 ) { | |
System.out.println(number + " is divisible by 5"); | |
}else | |
System.out.println(number); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment