Home » PHP » PHP Functions » Question
  1. What will be the output of the following PHP code?
    <?php
    function Add($n1, $n2)
    {
    $total = $n1 + $n2;
    echo cos($total);
    }
    Add(10,-10);
    ?>
    1. 0
    2. 1
    3. Error
    4. Nothing
    5. None of these
Correct Option: B

cos() gives the cos value of the argument. Here the function returns 1.



Your comments will be displayed only after manual approval.