Skip to content

Instantly share code, notes, and snippets.

@niravmadariya
Created June 7, 2018 07:04
Show Gist options
  • Save niravmadariya/204344b83e20d1acefdef3574b3ae2a9 to your computer and use it in GitHub Desktop.
Save niravmadariya/204344b83e20d1acefdef3574b3ae2a9 to your computer and use it in GitHub Desktop.
Given Number is Even or Odd
<html>
<head><title>Check if the number is Even or Odd</title></head>
<body>
<form method="post">
Enter the Number:<br>
<input type="number" name="number" id="number">
<input type="submit" name="submit" value="Submit" />
</form>
<?php
if($_POST['submit']){
$num = $_POST['number'];
if($number%2==0)
{
echo "$number is Even Number";
}
else
{
echo "$number is Odd Number";
}
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment