php program check to even or odd number
Even odd Program
php even odd program
Information ::-
1] Those EVEN Number - 2,4,6,8,10 etc.
2] those divisible by 2 number .
1] Those ODD Number - 1,3,5,7,9,11 etc.
2] Not divisible by 2 Number .
PHP Even Odd Program
Example :-
<?php
$no=100;
if($no%2==0)
{
echo"$no is even number";
}
else
{
echo "$no is odd number";
}
?>
php even odd program
Output :-
Even odd Program using FORM in php
Example :-
<form action="evenor-odd-form.php" method="get">
<input type="number" name="number" value="number" required>
<input type="submit" value="show" name="b1">
</form>
<?php
if(isset($_GET['b1']))
{
/* input */
$no =$_GET ['number'];
$result=($no %2==0)? "no even" :"no odd";
echo "$result";
}
?>
Post a Comment