Filters
Question type

Study Flashcards

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

Correct Answer

verifed

verified

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

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) ;

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.

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

Correct Answer

verifed

verified

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

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

Correct Answer

verifed

verified

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


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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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


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

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

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

Correct Answer

verifed

verified

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


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

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) ;

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.

Correct Answer

verifed

verified

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


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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Showing 21 - 40 of 41

Related Exams

Show Answer