Question
Check if a number is divisible by 5 or 6, both Use logical operators and output should be a boolean in JAVA Input Get one
Check if a number is divisible by 5 or 6, both Use logical operators and output should be a boolean in JAVA
Input
Get one a number from user .
Output:
Enter an integer: 25
Is 25 divisible by 5 and 6? false
Is 25 divisible by 5 or 6? true
Is 25 divisible by 5 or 6, but not both? true
Is 25 not divisible by both 5 and 6 true
Enter an integer: 30
Is 30 divisible by 5 and 6? True Is 30 divisible by 5 or 6? true
Is 30 divisible by 5 or 6, but not both? False Is 30 not divisible by both 5 and 6 false
Enter an integer: 32
Is 32 divisible by 5 and 6? False Is 32 divisible by 5 or 6? false
Is 32 divisible by 5 or 6, but not both? False Is 32 not divisible by both 5 and 6 true
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started