Question 1 of 25
Hints left: 3
Q1
In C++, what is a lambda function?
Q2
What is the syntax for declaring a function that takes a variable number of arguments in C++?
Q3
What is an inline function?
Q4
What is the scope of the variable declared in the user defined function?
Q5
Which of the following is the default return value of functions in C++?
Q6
What is the output of the following code: int add(int a, int b) { return a + b; } int sum = add(3, 5); cout << sum; in C++?
Q7
What is the purpose of the 'friend' keyword in a C++ function declaration?
Q8
What is the output of the following code: int x = 5; cout << "Before: " << x; changeValue(x); cout << "After: " << x; in C++?
Q9
What will be the output of the following C++ code? #include <iostream> using namespace std; void Funct(); int main() { try { Funct(); } catch(double) { cerr << "caught a double type..." << endl; } return 0; } void Funct() { throw 3; }
Q10
Identify the correct statement.
Q11
What does the 'void' keyword represent in the function declaration in C++?
Q12
What is the correct syntax for defining a function template in C++?
Q13
What is the purpose of the 'const' keyword in a function parameter list in C++?
Q14
Which of the following is true about inline functions in C++?
Q15
If an argument from the parameter list of a function is defined constant then . . . . . . . .
Q16
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; }
Q17
What is the purpose of the 'decltype' keyword in C++?
Q18
which of the following can be passed in function pointers?
Q19
What will be the output of the following code: void display() { cout << "Hello"; } int main() { display(); return 0; } in C++?
Q20
In C++, what is the significance of the function return type 'auto'?
Q21
What is the correct way to declare a function that takes a pointer as an argument in C++?
Q22
Identify the correct statement.
Q23
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; }
Q24
What will be the output of the following C++ code? #include <iostream> using namespace std; void Sum(int a, int b, int & c) { a = b + c; b = a + c; c = a + b; } int main() { int x = 2, y =3; Sum(x, y, y); cout << x << " " << y; return 0; }
Q25
If we start our function call with default arguments means, what will be proceeding arguments?