C++ - Module 9 Quiz

C++ - Module 9 Quiz

4th Grade

10 Qs

quiz-placeholder

Similar activities

Introduction to Arrays

Introduction to Arrays

KG - University

10 Qs

AstepI Quiz 3

AstepI Quiz 3

4th - 8th Grade

10 Qs

Programming C++

Programming C++

3rd - 5th Grade

10 Qs

Variables and Data Types

Variables and Data Types

3rd - 10th Grade

10 Qs

Programming

Programming

1st - 10th Grade

10 Qs

Chapter1.1

Chapter1.1

1st - 5th Grade

11 Qs

สอบกลางภาค JAVA เรียนที่ 1/2562

สอบกลางภาค JAVA เรียนที่ 1/2562

KG - 12th Grade

15 Qs

Python

Python

4th - 5th Grade

5 Qs

C++ - Module 9 Quiz

C++ - Module 9 Quiz

Assessment

Quiz

Computers

4th Grade

Hard

Created by

Eng. Ahmed Aweis

Used 1+ times

FREE Resource

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

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?