diff --git a/PHP/fizzbuzz_avijit.php b/PHP/fizzbuzz_avijit.php new file mode 100644 index 0000000..996cdb2 --- /dev/null +++ b/PHP/fizzbuzz_avijit.php @@ -0,0 +1,25 @@ +number = $number; + } + function generateFizzBuzz(){ + for ($i = 1; $i <= $this->number; $i=$i+1) { + if ($i % 3 === 0 && $i % 5 === 0) { + echo "FizzBuzz"."\n"; + } else if ($i % 3 === 0) { + echo "Fizz"."\n";; + } else if ($i % 5 === 0) { + echo "Buzz"."\n";; + } else { + echo $i; + } + } + return 0; + } + +} +$fizzObj = new FizzBuzz(12); +$fizzObj->generateFizzBuzz(); +?> \ No newline at end of file