Filters
Question type

Study Flashcards

Given the following function:what is the output of the following statement? cout << strange(4, 5) << endl; Given the following function:what is the output of the following statement? cout << strange(4, 5)  << endl;   A)  -1 B)  1 C)  9 D)  20


A) -1
B) 1
C) 9
D) 20

E) All of the above
F) A) and B)

Correct Answer

verifed

verified

If the formal parameter list of a function is empty, the parentheses after the function name are not needed.

A) True
B) False

Correct Answer

verifed

verified

The following return statement returns the value 10. return 10, 16;

A) True
B) False

Correct Answer

verifed

verified

Which statement below about prototypes and headers is true?


A) Parameter names must be listed in the prototype, but not necessarily in the header.
B) Prototypes end with a semicolon, but headers do not.
C) Headers should come before prototypes.
D) Headers end with a semicolon, but prototypes do not.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

The execution of a return statement in a user-defined function terminates the program.

A) True
B) False

Correct Answer

verifed

verified

The data type of a variable in a return statement must match the function type.

A) True
B) False

Correct Answer

verifed

verified

The function main is always compiled first, regardless of where in the program the function main is placed.

A) True
B) False

Correct Answer

verifed

verified

The statement: return 37, y, 2 * 3; returns the value ____.


A) 2
B) 3
C) y
D) 6

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

Which of the following function prototypes is valid?


A) int funcTest(int x, int y, float z) {}
B) funcTest(int x, int y, float) {};
C) int funcTest(int, int y, float z)
D) int funcTest(int, int, float) ;

E) All of the above
F) C) and D)

Correct Answer

verifed

verified

The statement: return 8, 10; returns the value ____.


A) 8
B) 10
C) 18
D) 80

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

Once you write and properly debug a function, you can use it in the program (or different programs) again and again without having to rewrite the same code repeatedly.

A) True
B) False

Correct Answer

verifed

verified

Given the following function:what is the output of the following statement? cout << next(next(5) ) << endl; Given the following function:what is the output of the following statement? cout << next(next(5) )  << endl;   A)  5 B)  6 C)  7 D)  8


A) 5
B) 6
C) 7
D) 8

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

A variable listed in a header is known as a(n) ____ parameter.


A) actual
B) local
C) formal
D) function

E) C) and D)
F) All of the above

Correct Answer

verifed

verified

Given the function prototype:float test(int, int, int) ; which of the following statements is legal?


A) cout << test(7, test(14, 23) ) ;
B) cout << test(test(7, 14) , 23) ;
C) cout << test(14, 23) ;
D) cout << test(7, 14, 23) ;

E) All of the above
F) None of the above

Correct Answer

verifed

verified

A function ____________________ is a function that is not fully coded.

Correct Answer

verifed

verified

The following function heading in a C++ program is valid:int funcExp(int u, char v, float g)

A) True
B) False

Correct Answer

verifed

verified

What value is returned by the following return statement? int x = 5; Return x + 1;


A) 0
B) 5
C) 6
D) 7

E) C) and D)
F) All of the above

Correct Answer

verifed

verified

A function prototype is ____.


A) a definition, but not a declaration
B) a declaration and a definition
C) a declaration, but not a definition
D) a comment line

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

The standard header file for the abs(x) function is ____.


A) <cmath>
B) <ioinput>
C) <cctype>
D) <cstdlib>

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

If a function needs to return more than one value, as a rule of good programming style, you should change it to a(n) ____________________ function and use the appropriate reference parameters to return the values.

Correct Answer

verifed

verified

Showing 21 - 40 of 41

Related Exams

Show Answer