0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

多言語FizzBuzzAdvent Calendar 2022

Day 22

多言語FizzBuzzチャレンジ22日目:PHP

Last updated at Posted at 2022-12-21

これまでのまとめ

本日のお品書き

PHP! 久々の手続型言語でホッとしますね…。

FizzBuzz

fizzbuzz.php
#!/usr/bin/php
<?php
for ($i = 1; $i < 101; $i++) {
    if ($i % 15 == 0) {
        echo "FizzBuzz\n";
    } else if ($i % 3 == 0) {
        echo "Fizz\n";
    } else if ($i % 5 == 0) {
        echo "Buzz\n";
    } else {
        echo ($i)."\n";
    }
}
?>

おまけ:実行方法

php fizzbuzz.php
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?