Question: 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

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.

Upload your php file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!