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

In Java, 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

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!