Quiz 6

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Given the following function definition void calc (int a, int& b) { int c; c = a + 2; a = a * 3; b = c + a; } What is the output of the following code fragment that invokes calc? (All variables are of type int) x = 1; y = 2; z = 3; calc(x, y); cout << x << " " << y << " " << z << endl;

1 6 3

What is the output of the following program? #include <iostream> using namespace std; int getValue(int); int main() { int x = 2; cout << getValue(x) << endl; return 0; } int getValue(int num) { return num + 5; }

7

A function __________ contains the statements that make up the function

definition

This is a collection of statements that performs a specific task.

function

This type of variable is defined inside a function and is not accessible outside the function.

local

A function can have zero to many parameters, and it can return this many values.

only one

A function __________ eliminates the need to place a function definition before all calls to the function.

prototype

When used as parameters, these types of variables allow a function to access the parameter's original argument.

reference

This statement causes a function to end.

return

The value in this type of local variable persists between function calls.

static


Set pelajaran terkait

Macro Economics Final Exam Chapter 10-16, 18-20

View Set

BLAW QUIZ 4 (okstate, holden, spring 2020)

View Set

Honors Geometry A Unit 7: Triangle Relationships

View Set

ACCT 1010 Proctored Exam Two Ch 5-10

View Set

PLAGIARISM: Appropriate Quotation (MLA 2016 Style)

View Set