FizzBuzz is a classic programming exercise, which is used in many job interviews. Basically, there are many people who like to call themselves programmers, who can’t actually program their way out of a paper bag. So to start an interview for a programming job, you might be asked to whip out a quick FizzBuzz solution, on a whiteboard or on a computer.
FizzBuzz is a weeding-out exercise. If you can’t do it, it shows that you know nothing meaningful about programming. If you can do it, nobody will be impressed, but you will probably get to participate in the rest of the interview.
- List the numbers from 1 to 1000. If the number is a multiple of 3, print the word “Fizz”. If the number is a multiple of 5, print the word “Buzz”. If the number is a multiple of both 3 and 5, print the word “FizzBuzz”.
- Prompt the user for the Fizz number and the Buzz number, and then respond appropriately.