C++ Functions Quiz

C++ Functions Quiz

12th Grade

10 Qs

quiz-placeholder

Similar activities

Functions in Python

Functions in Python

9th - 12th Grade

15 Qs

Python Exception Handling

Python Exception Handling

10th - 12th Grade

10 Qs

Basics of Functions in C Language

Basics of Functions in C Language

12th Grade

10 Qs

Python Functions

Python Functions

11th - 12th Grade

12 Qs

Spreadsheet - Basic Functions

Spreadsheet - Basic Functions

12th Grade

15 Qs

Functions C++

Functions C++

9th - 12th Grade

10 Qs

Mod 4 quiz

Mod 4 quiz

9th - 12th Grade

12 Qs

C++ Functions Quiz

C++ Functions Quiz

Assessment

Quiz

Computers

12th Grade

Hard

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?