Here is simple PHP code snippet to check if a given number is odd or even.
function checkEven($val){
return ($val%2 == 0);
}
|
$val = 7;
if(checkEven($val)){
echo "Number is even";
} else {
echo "Number is odd";
}
|
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment