
C++ Functions Quiz

Quiz
•
Computers
•
12th Grade
•
Hard
Devin Olson
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a function prototype in C++?
To declare the function before it is defined
To comment out the function
To hide the function from other files
To execute the function
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a function that takes two parameters in C++?
void functionName(parameter1, parameter2)
functionName(parameter1, parameter2)
int functionName(int parameter1, int parameter2)
void functionName(dataType parameter1, dataType parameter2)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the return type of a function declaration in C++?
The return type of a function declaration in C++ is a string
The return type of a function declaration in C++ is a data type (e.g. int, float, void, etc.)
The return type of a function declaration in C++ is an array
The return type of a function declaration in C++ is a boolean
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the concept of function overloading in C++.
Allows multiple functions with the same name and same parameters to be defined within the same scope
Only one function with a specific name can be defined within the same scope
Function overloading is not supported in C++
Allows multiple functions with the same name but different parameters to be defined within the same scope
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between function declaration and function definition in C++?
There is no difference between function declaration and function definition
Function declaration specifies the function name, return type, and parameters, while function definition provides the actual implementation of the function.
Function declaration provides the actual implementation of the function
Function definition specifies the function name, return type, and parameters
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the concept of default arguments in C++ function definition.
Default arguments in C++ function definition must be specified in the function call
Default arguments in C++ function definition are not allowed
Default arguments in C++ function definition can only be used for built-in data types
Default arguments in C++ function definition allow the parameters to have default values if no argument value is passed during function call.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the function body in C++ function definition?
To declare the function parameters
To store the function name
To provide the return type of the function
To contain the code that defines the behavior of the function
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Basics of Functions in C Language

Quiz
•
12th Grade
15 questions
Spreadsheet - Basic Functions

Quiz
•
12th Grade
12 questions
Mod 4 quiz

Quiz
•
9th - 12th Grade
10 questions
H466 - Global and Local Variables

Quiz
•
12th Grade - University
15 questions
Exploring Python Fundamentals

Quiz
•
12th Grade - University
10 questions
Random functions

Quiz
•
12th Grade
15 questions
Functions in Python

Quiz
•
9th - 12th Grade
10 questions
Python Exception Handling

Quiz
•
10th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade