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;
} #include <iostream>
using namespace std;
void square (int *x)
{
*x = (*x + 1) * (*x);
}
int main ( )
{
int num = 10;
square(&num);
cout << num;
return 0;
}
a.
100
b.
compile time error
c.
144
d.
110
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. 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
Q. When our function doesn’t need to return anything means what will we use/send as parameter in function?
View solution
Q. What are the advantages of passing arguments by reference?
View solution
Q. If the user didn’t supply the value, what value will it take?
View solution
Q. Where can the default parameter be placed by the user?
View solution
Q. Which value will it take when both user and default values are given?
View solution
Q. What we can’t place followed by the non-default arguments?
View solution
Q. If we start our function call with default arguments means, what will be proceeding arguments?
View solution
Q. What is the default return type of a function ?
View solution
Q. Which header file is used to pass unknown number of arguments to function?
View solution
Q. How can you access the arguments that are manipulated in the function?
View solution
Q. What is the maximum number of arguments or parameters that can be
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!