C Programming - Functions - Discussion

Discussion Forum : Functions - Point Out Correct Statements (Q.No. 3)
3.
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;
}
The function calculates the value of 1 raised to power num.
The function calculates the square root of an integer
The function calculates the factorial value of an integer
None of above
Answer: Option
Explanation:

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

Discussion:
19 comments Page 2 of 2.

Srikanth said:   1 decade ago
What is the value of num variable?

Tripti said:   1 decade ago
I don't understand why to use num?

Usha said:   1 decade ago
How it calculates fraction value?

Aman said:   1 decade ago
But there is no value for number?

Bharu said:   1 decade ago
Can anyone please explain this?

Nikky said:   1 decade ago
What is the value of num?

Dheeraj said:   1 decade ago
Why return is used here?

Hari said:   10 years ago
I can't understand.

Chandrakala said:   3 years ago
Very nice.


Post your comments here:

Your comments will be displayed after verification.