Question: Task 01: Write a C program that prompts and reads an integer number r. It then checks the mumber for divisibility by 3 and 5
Task 01: Write a C program that prompts and reads an integer number r. It then checks the mumber for divisibility by 3 and 5 and prints one of the following messages accordingly The number x is divisible by both 3 and 5 The number x is divisible by 3 but not 5 The number x is divisible by 5 but not 3 The number x is neither divisible by 3 nor by 5 Where x in the above messages is the actual integer that was read Hint: Use the modulus operator (%) to check the number for divisibility. An integer x is divisible by an integer y if x is a multiple of y Sample program runs: Enter an integer number: 15 The number 15 is divisible by both 3 and 5 Enter an integer number: -12 The number -12 is divisible by 3 but not S Enter an Integer number: 25 The number 25 is divisible by 5 but not 3 Enter an integer number: 8 The number 8 is neither divisible by 3 nor by5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
