
C++ Functions Quiz
Authored by Devin Olson
Computers
12th Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Printers
Quiz
•
9th - 12th Grade
10 questions
Hệ Điều Hành Của Máy Tính
Quiz
•
10th Grade - University
15 questions
User Interface Design - Topic 1
Quiz
•
12th Grade
10 questions
Treasure Hunt
Quiz
•
12th Grade
10 questions
Banco de Dados
Quiz
•
10th - 12th Grade
10 questions
Greetings
Quiz
•
1st Grade - University
12 questions
Informatika blokk 1
Quiz
•
12th Grade
10 questions
Tipos de bases de datos
Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade