Remember the game of FizzBuzz from the last ime? Well, I thought of some changes in the game, and also with the help of loops as well. Firstly, you'll be asking for a random integer and then loop from until that integer. Then, implement these conditions in the game: • print "Fizz" if the number is divisible by 3 • print "Buzz" if the number is divisible by 5 • print "FizzBuzz" if the number is divisible by both 3 and 5 • print the number itself if none of the above conditions are met mput . An integer Dutput "he first line will contain a message prompt to input he integer. The succeeding lines will contain either a string or un integer.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 15E
icon
Related questions
Question
main.c
< > +c
Test Cases
Executions
1. FizzBuzz 2.0
by CodeChum Admin
1
E Run Tests
Remember the game of FizzBuzz from the last
time? Well, I thought of some changes in the game,
and also with the help of loops as well. Firstly, you'll
O Test Case 1
be asking for a random integer and then loop from
1 until that integer. Then, implement these
conditions in the game:
Your Output
No Output
• print "Fizz" if the number is divisible by 3
• print "Buzz" if the number is divisible by 5
• print "FizzBuzz" if the number is divisible by
Expected Output
both 3 and 5
Enter n: 15
• print the number itself if none of the above
conditions are met
2
Fizz
4
Input
Buzz
Fizz
1. An integer
7
8
Output
Fizz
The first line will contain a message prompt to input
Buzz
the integer.
The succeeding lines will contain either a string or
11
Fizz
an integer.
13
14
FizzBuzz
Transcribed Image Text:main.c < > +c Test Cases Executions 1. FizzBuzz 2.0 by CodeChum Admin 1 E Run Tests Remember the game of FizzBuzz from the last time? Well, I thought of some changes in the game, and also with the help of loops as well. Firstly, you'll O Test Case 1 be asking for a random integer and then loop from 1 until that integer. Then, implement these conditions in the game: Your Output No Output • print "Fizz" if the number is divisible by 3 • print "Buzz" if the number is divisible by 5 • print "FizzBuzz" if the number is divisible by Expected Output both 3 and 5 Enter n: 15 • print the number itself if none of the above conditions are met 2 Fizz 4 Input Buzz Fizz 1. An integer 7 8 Output Fizz The first line will contain a message prompt to input Buzz the integer. The succeeding lines will contain either a string or 11 Fizz an integer. 13 14 FizzBuzz
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Basics of loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,