Filters
Question type

Study Flashcards

One reason for using functions is to break programs into manageable units, or modules.

Correct Answer

verifed

verified

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


A) global
B) reference
C) local
D) counter
E) None of these

Correct Answer

verifed

verified

A ________ variable is declared outside all functions.


A) local
B) global
C) floating-point
D) counter
E) None of these

Correct Answer

verifed

verified

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


A) zero to many
B) no
C) only one
D) a maximum of ten
E) None of these

Correct Answer

verifed

verified

You may use the exit()function to terminate a program, regardless of which control mechanism is executing.

Correct Answer

verifed

verified

This function causes a program to terminate, regardless of which function or control mechanism is executing.


A) terminate()
B) return()
C) continue()
D) exit()
E) None of these

Correct Answer

verifed

verified

This statement causes a function to end.


A) end
B) terminate
C) return
D) release
E) None of these

Correct Answer

verifed

verified

If a function does not have a prototype, default arguments may be specified in the function ________.


A) call
B) header
C) execution
D) return type
E) None of these

Correct Answer

verifed

verified

A static variable that is defined within a function is initialized only once, the first time the function is called.

Correct Answer

verifed

verified

A local variable and a global variable may not have the same name within the same program.

Correct Answer

verifed

verified

False

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


A) global
B) internal
C) static
D) dynamic
E) None of these

Correct Answer

verifed

verified

What is the output of the following program? What is the output of the following program?   A)  2 2 B)  4 2 C)  2 4 D)  4 4


A)
2
2
B)
4
2
C)
2
4
D)
4
4

Correct Answer

verifed

verified

These types of arguments are passed to parameters automatically if no argument is provided in the function call.


A) Local
B) Default
C) Global
D) Relational
E) None of these

Correct Answer

verifed

verified

A parameter is a special-purpose variable that is declared inside the parentheses of a function definition.

Correct Answer

verifed

verified

True

________ functions may have the same name, as long as their parameter lists are different.


A) Only two
B) Two or more
C) Zero
D) Un-prototyped
E) None of these

Correct Answer

verifed

verified

Look at the following function prototype. Look at the following function prototype.   What is the data type of the function's parameter variable? A) int B) double C) void D) Can't tell from the prototype What is the data type of the function's parameter variable?


A) int
B) double
C) void
D) Can't tell from the prototype

Correct Answer

verifed

verified

Which of the following statements about global variables is true?


A) A global variable is accessible only to the main function.
B) A global variable is declared in the highest-level block in which it is used.
C) A global variable can have the same name as a variable that is declared locally within a function.
D) If a function contains a local variable with the same name as a global variable, the global variable's name takes precedence within the function.
E) All of these are true.

Correct Answer

verifed

verified

The value in a ________ variable persists between function calls.


A) dynamic
B) local
C) counter
D) static local

Correct Answer

verifed

verified

Which line in the following program contains a call to the showDub function? Which line in the following program contains a call to the showDub function?   A) 4 B) 6 C) 10 D) 15


A) 4
B) 6
C) 10
D) 15

Correct Answer

verifed

verified

C

Look at the following function prototype. Look at the following function prototype.    What is the data type of the function's return value? A) int B) double C) void D) Can't tell from the prototype What is the data type of the function's return value?


A) int
B) double
C) void
D) Can't tell from the prototype

Correct Answer

verifed

verified

Showing 1 - 20 of 49

Related Exams

Show Answer