Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that prompts the user to enter three integers a, b, and c, determines whether a is divisible by b and c, whether

Write a program that

prompts the user to enter three integers a, b, and c,

determines

whether a is divisible by b and c,

whether a is divisible by b or c,

and whether a is divisible by b or c, but not both. Hint: using xor, i.e. (a%b==0) ^ (a%c==0)

Test scenarios and sample outputs:

Please enter three integers: 10 5 6 Is 10 divisible by 5 and 6? false Is 10 divisible by 5 or 6? true Is 10 divisible by 5 or 6, but not both? true Please enter three integers: 1024 64 46 Is 1024 divisible by 64 and 46? false Is 1024 divisible by 64 or 46? true Is 1024 divisible by 64 or 46, but not both? true

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

Question

What are the purposes of collection messages? (Objective 5)

Answered: 1 week ago