Masala #4PN4F9OG1M
FizzBuzz #2
Given an integer n, for every integer i <= n, the task is to print “FizzBuzz” if i is divisible by 3 and 5, “Fizz” if i is divisible by 3, “Buzz” if i is divisible by 5 or i (as a string) if none of the conditions are true.
N kirib keladi
Javob ni chop eting
# | input.txt | output.txt |
---|---|---|
1 |
3 |
1 2 Fizz |
Iterate on the given number from 1 to n, check its divisibility and add the string into result according to the given condition.