Question 1 of 25
Hints left: 3
Q1
What will be the output of the following code: int add(int x, int y) { return x + y; } int main() { cout << add(2); } in C++?
Q2
What is the output of the following code: int square(int x) { return x * x; } int main() { cout << square(3) + square(2); } in C++?
Q3
What is the purpose of passing arguments by reference in C++ functions?
Q4
Which of the following is a valid function declaration in C++?
Q5
What is the correct syntax for defining a recursive function in C++?
Q6
Which of the following is true about function overloading in C++?
Q7
What will be the output of the following code: int max(int a, int b) { return (a > b) ? a : b; } cout << max(5, 3); in C++?
Q8
What is the purpose of default arguments in C++ functions?
Q9
What is the purpose of the 'void' keyword in a function declaration in C++?
Q10
What is the purpose of a function header in C++?
Q11
What does the 'inline' keyword do in C++ function declaration?
Q12
What is the purpose of the 'extern' keyword in a function declaration in C++?
Q13
What is the output of the following code: int multiply(int x, int y) { return x * y; } int main() { cout << multiply(3, 4); } in C++?
Q14
In C++, how are function arguments passed by default?
Q15
What is the syntax for defining a recursive function in C++?
Q16
What is the purpose of the 'static' keyword in a function declaration in C++?
Q17
Which of the following is true about function parameters in C++?
Q18
What is the purpose of function overloading in C++?
Q19
What is the correct syntax for declaring a function prototype in C++?
Q20
What is the output of the following code: int max(int a, int b) { return (a > b) ? a : b; } int main() { cout << max(5, 5); } in C++?
Q21
What is the purpose of the 'static' keyword in a C++ function?
Q22
What is the correct way to pass an array to a function in C++?
Q23
What is the purpose of a function in C++?
Q24
What is the correct way to declare a function in C++ that takes no parameters and returns an integer?
Q25
Which of the following is true about function recursion in C++?