Even or Odd
PHP
Easy
4 views
Problem Description
Check if n is even or odd.
Input Format
One integer n.
Output Format
EVEN or ODD.
Official Solution
<?php
$inputText=trim(stream_get_contents(STDIN));
if($inputText==='') exit;
$n=intval($inputText);
echo ($n%2===0)?'EVEN':'ODD';
?>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!