Question
#include <iostream>
using namespace std;
long factorial (long a)
{
if (a > 1)
return (a * factorial (a + 1));
else
return (1);
}
int main ()
{
long num = 3;
cout << num << "! = " << factorial ( num );
return 0;
}
a.
6
b.
24
c.
segmentation fault
d.
compile time error
Posted under Object Oriented Programming Using C++
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. What will happen when we use void in argument passing?
View solution
Q. Where does the execution of the program starts?
View solution
Q. What are mandatory parts in function declaration?
View solution
Q. which of the following is used to terminate the function declaration?
View solution
Q. How many max number of arguments can present in function in c99 compiler?
View solution
Q. Which is more effective while calling the functions?
View solution
Q. What is the scope of the variable declared in the user definied function?
View solution
Q. How many minimum number of functions are need to be presented in c++?
View solution
Q. How many ways of passing a parameter are there in c++?
View solution
Q. Which is used to keep the call by reference value as intact?
View solution
Q. By default how the value are passed in c++?
View solution
Q. How many types of returning values are present in c++?
View solution
Q. What will you use if you are not intended to get a return value?
View solution
Q. Where does the return statement returns the execution of the program?
View solution
Q. When will we use the function overloading?
View solution
Q. Which of the following permits function overloading on c++?
View solution
Q. In which of the following we cannot overload the function?
View solution
Q. Function overloading is also similar to which of the following?
View solution
Q. Overloaded functions are
View solution
Q. What will happen while using pass by reference
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Object Oriented Programming Using C++? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!