PHP Armstrong NumberPHP Average of N NumbersPHP Biggest of Three NumbersPHP Common DivisorsPHP Composite NumberPHP Condense a NumberPHP Even NumberPHP Factorial of a NumberPHP Fibonacci SeriesPHP GCDPHP LCMPHP Leap YearPHP Multiplication TablePHP Number CombinationPHP Odd NumberPHP Palindrome NumberPHP Perfect NumberPHP Prime FactorPHP Prime NumberPHP Sum of DigitsPHP Swapping Two Numbers

PHP Array ProgramsPHP Converter ProgramsPHP Star Patterns ProgramPHP Number Patterns ProgramPHP Alphabet Patterns ProgramLast Updated:

An integer (never a fraction) that cannot be divided exactly by 2. For example, 3 is an odd number, i.e., 3 % 2 = 1 (not zero).

**Note**: % is a Modulus (Division Remainder) operator, it finds the remainder after division of one number by another. Please check our Arithmetic Operators for more details.

**Tips**: It is recommended to use our online Odd Numbers calculator for better understanding.

In the following example, we will find all the Odd Numbers between 10 and 25 using for loop.

PHP Compiler

<?php
$start = 10;
$end = 25;
echo "Odd numbers between $start and $end: <br>";
for($start=$start; $start<=$end; $start++)
{
if($start % 2 != 0)
echo "$start ";
}
?>

In the following example, we will find all the Odd Numbers between 10 and 25 using while loop.

PHP Compiler

<?php
$start = 10;
$end = 25;
echo "Odd numbers between $start and $end: <br>";
while($start <= $end)
{
if($start % 2 != 0)
echo "$start ";
$start++;
}
?>

In the following example, we will find all the Odd Numbers between 10 and 25 using do while loop.

PHP Compiler

<?php
$start = 10;
$end = 25;
echo "Odd numbers between $start and $end: <br>";
do{
if($start % 2 != 0)
echo "$start ";
$start++;
}while($start <= $end);
?>