Filters
Question type

Study Flashcards

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


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

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

Correct Answer

verifed

verified

Assume that all variables are properly declared. The following statement in a value-returning function is legal. if (x % 2 == 0) return x; else return x + 1;

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 following function prototype: double tryMe(double, double) ;, which of the following statements is valid? Assume that all variables are properly declared.


A) cin >> tryMe(x) ;
B) cout << tryMe(2.0, 3.0) ;
C) cout << tryMe(tryMe(double, double) , double) ;
D) cout << tryMe(tryMe(float, float) , float) ;

Correct Answer

verifed

verified

The ____________________ of an identifier refers to where in the program an identifier is accessible (visible).

Correct Answer

verifed

verified

scope

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


A) cout << test(12, &) ;
B) cout << test("12.0", '&') ;
C) int u = test(5.0, '*') ;
D) cout << test('12', '&') ;

Correct Answer

verifed

verified

____________________ identifiers are not accessible outside of the function (block).

Correct Answer

verifed

verified

When you attach & after the dataType in the formal parameter list of a function, the variable following that dataType becomes a(n) ____________________ parameter.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Assume the following. static_cast<int>('a') = 97 Static_cast<int>('A') = 65 The output of the statement: Cout << static_cast<int>(tolower('B') ) << endl; is ____.


A) 65
B) 67
C) 96
D) 98

Correct Answer

verifed

verified

Which of the following function prototypes is valid?


A) int funcExp(int x, float v) ;
B) funcExp(int x, float v) {};
C) funcExp(void) ;
D) int funcExp(x) ;

Correct Answer

verifed

verified

A

The program that tests a function is called a(n) ____________________ program.

Correct Answer

verifed

verified

The output of the statement: cout << tolower('$') << endl; Is ____.


A) '$'
B) '0'
C) '1'
D) An error, because you cannot use tolower with '$'.

Correct Answer

verifed

verified

A

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


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

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 following return statement returns the value 10. return 10, 16;

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Given the following function: int next(int x) { \quad Return (x + 1) ; } What is the output of the following statement? Cout << next(next(5) ) << endl;


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

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

Showing 1 - 20 of 50

Related Exams

Show Answer