ExamVeda
Login
Home
This question belongs to PHP Functions
Functions
?

What will be the output of the following PHP code ?
<?php
function start($string)
{
    if ($string < 45)
        return 20;
    else
        return 40;
}
$t = start(90);
if ($t < 20)
{
    echo "Have a good day!";
}
else
{
    echo "Have a good night!";
}
?>

Answer & Solution
Correct Answer: Option B
Function returns 40. this is greater than 20, hence the output.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.