Question
Using PHP: Write a program that uses a loop to print the integers 1 to 100, one number on each line. When a number is
Using PHP:
Write a program that uses a loop to print the integers 1 to 100, one number on each line. When a number is divisible by 3, print "Blue" on the same line, and separate them by a space. When a number is divisible by 5, print "Berry"; and when a number is divisible by 15, print "Blueberry".
Note that a number divisible by 15 will also be divisible by 3 and 5. In this case, only "Blueberry" should be printed.
Provide an input form that accepts a number n that determines how many times the loop should iterate (100 in the example above). The form should also allow the end-user to enter any two words to display and concatenate (e.g., "Blue" and "Berry" above).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started