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