Correct Answer is : Exception caught
10. Which of the following is the default return value of functions in C++?
Correct Answer is : inheriting and overriding exception class functionality
11. What is an inline function?
Correct Answer is : bad_cast
12. An inline function is expanded during ______________
Correct Answer is : return
13. In which of the following cases inline functions may not word?
i) If the function has static variables.
ii) If the function has global and register variables.
iii) If the function contains loops
iv) If the function is recursive
Correct Answer is : All of the mentioned
14. When we define the default values for a function?
Correct Answer is : Set a global error indicator
15. Where should default parameters appear in a function prototype?
16. If an argument from the parameter list of a function is defined constant then _______________
17. Which of the following feature is used in function overloading and function with default argument?
Correct Answer is : Error
18. What is the output of the following C++ code?
#include
using namespace std;
int fun(int x = 0, int y = 0, int z)
{ return (x + y + z); }
int main()
{
cout << fun(10);
return 0;
}
Correct Answer is : Improve the exception safety
19. What is the output of the following C++ code?
#include
using namespace std;
class Test
{
protected:
int x;
public:
Test (int i):x(i) { }
void fun() const { cout << "fun() const " << endl; }
void fun() { cout << "fun() " << endl; }
};
int main()
{
Test t1 (10);
const Test t2 (20);
t1.fun();
t2.fun();
return 0;
}
20. What is the output of the following C++ code?
#include
using namespace std;
int fun(int=0, int = 0);
int main()
{
cout << fun(5);
return 0;
}
int fun(int x, int y) { return (x+y); }
Correct Answer is : Use the stack