This program will solve the classic "FizzBuzz" problem posed in many programing interviews. The idea is to examine all the numbers between start and stop. If the number is divisible by 3, then print "Fizz." If the number is divisible by 5 then print "Buzz." If it is divisible by both then print "FizzBuzz." Otherwise, just print the number. Start 27 Stop 45 Submit O Cancel FizzBuzz between 27 and 45 • Fizz • 28 • 29 • FizzBuzz 31 • 32 • Fizz • 34 • Buzz • Fizz 37 • 38 • Fizz • Buzz • 41 • Fizz • 43 • 44 • FizzBuzz
USING PHP
Write a solution to the “FizzBuzz” problem. The FizzBuzz problem is a classic programming interview problem in which a range of numbers is examined to locate those numbers divisible by 3 and 5. If the number is divisible by 3, then print "Fizz." If the number is divisible by 5 then print "Buzz." If it is divisible by both, then print "FizzBuzz." Otherwise, just print the number.
You should have an index.html(index.php) file. The index.html (index.php) has a form that submits data to the itself. You may optionally have a style file as well, referenced from both. If the user does not submit a start and stop number for the range (inclusive), then assume that start is 1 and stop is 100. Otherwise, use the specified range.
You may use either GET or POST for your form processing. Screen shots of one sample solution are given. You should try to get your solution to look as close to this output as possible.
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 2 images