Write a php program to print a given integer number is odd or even

Write a php program to print a given integer number is odd or even. Here’s the script which helps you to find the number is odd or even in PHP. This program will check the number whether it is odd number or even number in php

<?php 
$num=100;
if($num%2==0)
{
echo "$num is Even num";
}
else
{
echo "$num is Odd num";
}
?>

 

Output:

100 is Even num

What is odd number and even number in php

A number that can be divided into two equal groups is called an even number. A number that cannot be divided into two equal groups is called an odd number. Even numbers, regardless of how many digits they contain, end in 2, 4, 6, 8, and 0; we know the number 5,917,624 is even since it ends in a 4!. When two odd numbers are added together, the result is always even. When two or more odd integers are added together, the result is always odd. An even number of odd numbers adds up to an even amount, while an odd number of odd numbers adds up to an odd sum.

Which is best odd number or even number

Even numbers are more appreciated and viewed as calmer and nicer than odd numbers, thus it’s remarkable that our favourite number is 7, an odd number. In fact, according to my poll, odd numbers are far more popular than even numbers. Arithmetic determines our response.