PHP Online Compiler
Example: PHP Program to Check Whether a Number is Even or Odd using If-else Statement
C
C++
C#
Java
Python
PHP
main.php
STDIN
Run
<?php // PHP Program to Check Whether a Number is Even or Odd using If-else Statement $x = 26; echo "Input Number: ", $x, "\n\n"; if ($x % 2 == 0) { echo "The input number is even number.\n"; } else { echo "The input number is odd number.\n"; } ?>
Output
Clear
ADVERTISEMENTS