. Write a program to print the perfect multiple of both 5 as well as 3, within a user given range, using For loop.
Answers
Answered by
1
Answer:
Given a positive number n, write a function isMultipleof5(int n) that returns true if n is multiple of 5, otherwise false. You are not allowed to use % and / operators.
Method 1 (Repeatedly subtract 5 from n)
Run a loop and subtract 5 from n in the loop while n is greater than 0. After the loop terminates, check whether n is 0. If n becomes 0 then n is multiple of 5, otherwise not.
Similar questions