Functions

Q1: Which of the following statement is correct about the program given below?
#include<iostream.h> 
long FactFinder(long = 5); 
int main()
{
    for(int i = 0; i<= 0; i++)
        cout<< FactFinder() << endl; 
    return 0;
}
long FactFinder(long x)
{
    if(x < 2)
        return 1; 
    long fact = 1; 
    for(long i = 1; i <= x-1; i++)
        fact = fact * i; 
    return fact; 
}

A The program will print the output 1.

B The program will print the output 24.

C The program will print the output 120.

D The program will print the output garbage value.

E The program will report compile time error.

ANS:B - The program will print the output 24.

No answer description is available. Let's discuss.



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.