Multiples of 3 and 5 without using % operator - GeeksforGeeks
Write a short program that prints each number from 1 to n on a new line.
- For each multiple of 3, print "Multiple of 3" instead of the number.
- For each multiple of 5, print "Multiple of 5" instead of the number.
- For numbers which are multiples of both 3 and 5, print "Multiple of 3. Multiple of 5." instead of the number.
Read full article from Multiples of 3 and 5 without using % operator - GeeksforGeeks
No comments:
Post a Comment