Question 1: C++ Function Declaration
Which of the following is the correct way to declare a function in C++ that returns an integer and takes no arguments?
Question 2: C++ Function Definition
What is the correct way to define a function named add that takes two integers and returns their sum?
Question 3: C++ Guess the Output – Function Return
What will be the output of the following C++ code?
Question 4: C++ Function Overloading
Which of the following demonstrates valid function overloading in C++?
Question 5: C++ Guess the Output – Pass by Value
What will be the output of the following code?
Question 6: C++ Pass by Reference
Which of the following correctly demonstrates pass by reference in C++?
Question 7: C++ Default Arguments
Which function declaration is valid with default arguments?
Question 8: C++ Inline Functions
What is the purpose of an inline function in C++?
Question 9: C++ Guess the Output – Recursion
What will be the output of the following program?
Question 10: C++ Function Prototypes
Why are function prototypes used in C++?