Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3 from Chamudi/Chamudi-php
Browse files Browse the repository at this point in the history
fizzbuzz php
  • Loading branch information
Chamudi authored Oct 1, 2020
2 parents e157cab + e058645 commit 42b62ca
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions PHP/fizzbuzz-php.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//fizzbuzz php programming
// Author: @Chamudi
<?php
$_fp = fopen("php://stdin", "r");


for($i=1; $i<=100; $i++){
$check_fizz = $i%3;
$check_buzz = $i%5;
$print = "";

if($check_fizz == 0)
$print .= "Fizz";
if($check_buzz == 0)
$print .= "Buzz";


if($print == "")
echo $i;
else
echo $print;

echo "\n";

}
?>

0 comments on commit 42b62ca

Please sign in to comment.