• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Data Science by
Q:
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 Dec 4, 2020 in Amazon Elastic Compute Cloud EC2 by sharadyadav1986
0 votes
asked Mar 3, 2020 in DevOps by rajeshsharma
...