--:--









Quiz for Function declaration, definition, and calling

Course: C++ Language | Subject: Unit 3 | Topic: Functions and Function Overloading



Logo

Q1: What is the correct way to declare a function in C++?

Logo

Q2: Where is a function defined in C++?

Logo

Q3: Which part of function tells the compiler about function’s existence?

Logo

Q4: How do you call a function named compute with no arguments?

Logo

Q5: What keyword is used to define the return type of a function?

Logo

Q6: What happens if a function does not return a value but declared with a non-void return type?

Logo

Q7: Can functions be declared multiple times?

Logo

Q8: Which is correct function definition syntax?

Logo

Q9: What keyword is used to specify a function does not return a value?

Logo

Q10: Can functions call other functions in C++?

Logo

Q11: What is function overloading?

Logo

Q12: Which of the following is not valid function overloading criteria?

Logo

Q13: How to declare a function prototype?

Logo

Q14: What is the output of this code? int square(int x) { return x*x; } cout << square(5);

Logo

Q15: Can default arguments be specified in function declaration?

Logo

Q16: What happens if you call a function with fewer arguments than parameters with defaults?

Logo

Q17: Can a function be defined inside another function in C++?

Logo

Q18: Which of the following is a correct call to function int add(int a, int b)?

Logo

Q19: What is the return type of main() function in C++?

Logo

Q20: What keyword can specify inline function?

Are you ready to start test? Set your time limit