Question: Write a program that asks the user to input an integer and test divisibility. For the integer input, display one(and only one) message based on

Write a program that asks the user to input an integer and test divisibility. For the integer input, display one(and only one) message based on the following rules: If it is divisible by both 3 and 5, it should display "Divisible by 15." If the number is divisible by 3, it should display "Divisible by 3." If it is divisible by 5, it should display "Divisible by 5." If the number is not divisible by either 3 or 5, display the "Neither." Sample runs Input 1: 5 Output 1: Divisible by 5. Input 2: 9 Output 2: Divisible by 3.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!