Search Header Logo

C++ - Module 9 Quiz

Authored by Eng. Ahmed Aweis

Computers

4th Grade

Used 1+ times

C++ - Module 9 Quiz
AI

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

2 mins • 1 pt

What is a parameter in a C++ function?

C. A keyword to end the function

B. A variable used within the function

A. A value passed when declaring a function

D. A data type used for calculations

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What does the function printNum(int num) do?

B. Adds num to another variable

A. Prints the value of num

D. Checks if num is even

C. Multiplies num by 2

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is the purpose of the return statement in a C++ function?

D. Loops through the code again

C. Initializes a variable

B. Prints a message to the console

A. Ends the function execution

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

In the function displayNum(int n1, float n2), what are n1 and n2?

C. Function parameters

B. Data types

A. Function names

D. Return values

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is the output of the program when num1 is 5 and num2 is 5.5?

C. The int number is 5 The double number is 5.55

B. The int number is 5 The double number is 5

D. The int number is 5 The double number is 5.0

A. The int number is 5 The double number is 5.5

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What does the code return (a + b); do in the add() function?

A. Subtracts a from b

B. Multiplies a by b

C. Divides a by b

D. Returns the sum of a and b

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What data type is used in the function add(int a, int b) to return a value?

D. float

A. void

B. double

C. int

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?