Skip to content

Instantly share code, notes, and snippets.

@avinashdexterous
Forked from tchalvak/cakepi.php
Created December 20, 2012 14:35
Show Gist options
  • Select an option

  • Save avinashdexterous/4345616 to your computer and use it in GitHub Desktop.

Select an option

Save avinashdexterous/4345616 to your computer and use it in GitHub Desktop.
<?php
/*
Using php, write a program that must fulfill these requirements:
For the numbers from 1 to 100,
If the number is a multiple of 3, print cake instead of the number.
If the number is a multiple of 5, print pi instead of the number.
If the number is a multiple of 15, print cakepi instead of the number.
Otherwise, print the number itself.
Each number's output should be followed by a new line.
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment