Print even and odd number in php ?



 <?php

for($i=1;$i<=20;$i++)

{

if($i%2==0)

{

echo "even".$i;

echo "\t";

}

else

{

echo "odd".$i;

echo "\t";

 }

?>


To run and Output:-


 


No comments:

Post a Comment

theengineerschoice01@gmail.com