Test if input number is divisible by 3.
62 views (last 30 days)
I want to write a program to request a number from the user, and do one of two things:
- If the number is divisible by three, output that it is divisible by 3 and state the quotient.
- If the number is NOT divisible by three, state this, and report back the quotient and remainder.
How would I go about this?
Bjorn Gustavsson on 9 Aug 2022
Have a look at the help and documentation for while. Also from the question I guess that you're reasonably new to programming. If that's the case have a walk through the on-ramp material. That is designed to get you up to speed with programming, and supposedly no other way should be better than you browsing through that focusing on the parts that are of most interest and relevance to you.