Question:

Why is this so??.....

by  |  earlier

0 LIKES UnLike

Given:

var result;

function getH(num1, num2, num3) {

if (isNaN(num1) || isNaN(num2) || isNaN(num3)) {

alert("getH: error in parameters");

return false;

}

else {

result=(num1 num2 num3)/3;

return true;

}

}

What will be the output, if you make the following function call:

getH(3,4,5);

a) error occurs

b) an alert box display getH: error in parameters

c) 4

d) no output

The answer is d.. why? the 3,4 and 5 are indeed numbers.. so answer should be c...

 Tags:

   Report

1 ANSWERS


  1. What language is this supposed to be in?  Well, for one thing, the line:

    result=(num1 num2 num3)/3

    What does this language do with that?  What does:

    result=(3 4 5)/3

    mean?  Does it add the numbers in the parentheses?  Multiply them?

    Secondly, the function returns either true or false.  It doesn't print anything/have any output when it computes the value of result.

You're reading: Why is this so??.....

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions