Functions

Q1: Which of the following statements are correct about the function?
long fun(int num)
{
    int i;
    long f=1;
    for(i=1; i<=num; i++)
        f = f * i;
    return f;
}

A The function calculates the value of 1 raised to power num.

B The function calculates the square root of an integer

C The function calculates the factorial value of an integer

D None of above

ANS:C - The function calculates the factorial value of an integer

Yes, this function calculates and return the factorial value of an given integer num.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.