Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions