+1 vote
in Data Science by
In your choice of language, write a program that prints the numbers ranging from one to 50.

1 Answer

0 votes
by

But for multiples of three, print "Fizz" instead of the number, and for the multiples of five, print "Buzz." For numbers which are multiples of both three and five, print "FizzBuzz" 

The code is shown below:

fizzbuzz-code

Note that the range mentioned is 51, which means zero to 50. However, the range asked in the question is one to 50. Therefore, in the above code, you can include the range as (1,51).

The output of the above code is as shown:

fizz

Related questions

0 votes
asked Oct 23, 2020 in JAVA by rahuljain1
+1 vote
asked Jul 9, 2021 in NumPy by rajeshsharma
...