41. In C++, what is a lambda function?
42. What is the purpose of the 'decltype' keyword in C++?
43. What is the correct way to declare a function that takes a pointer as an argument in C++?
44. What will be the output of the following code: void display() { cout << "Hello"; } int main() { display(); return 0; } in C++?
45. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int func (int a, int b)
{
cout << a;
cout << b;
return 0;
}
int main(void)
{
int(*ptr)(char, int);
ptr = func;
func(2, 3);
ptr(2, 3);
return 0;
}
#include <iostream>
using namespace std;
int func (int a, int b)
{
cout << a;
cout << b;
return 0;
}
int main(void)
{
int(*ptr)(char, int);
ptr = func;
func(2, 3);
ptr(2, 3);
return 0;
}
46. If we start our function call with default arguments means, what will be proceeding arguments?
47. Which of the following is the default return value of functions in C++?
48. What is an inline function?
49. What will be the output of the following C++ code?
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;
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;
}
50. Identify the correct statement.
Read More Section(Functions and Procedures in C plus plus)
Each Section contains maximum 100 MCQs question on Functions and Procedures in C plus plus. To get more questions visit other sections.