Exam 6: Functions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The value in a(n) _______ variable persists between function calls.

(Multiple Choice)
4.8/5
(78)

What is the output of the following program? #include <iostream> using namespace std; void showDub(int); int main() { \quad int x = 2; \quad showDub(x); \quad cout << x << endl; \quad return 0; } void showDub(int num) { \quad cout << (num * 2) << endl; }

(Multiple Choice)
4.8/5
(70)

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

(True/False)
4.9/5
(74)

In a function header, you must furnish

(Multiple Choice)
4.9/5
(75)

Which line in the following program contains the prototype for the showDub function? 1 \quad #include <iostream> 2 \quad using namespace std; 3 4 \quad void showDub(int); 5 6 \quad int main() 7 \quad { 8 \quad\quad int x = 2; 9 10 \quad\quad showDub(x); 11 \quad\quad cout << x << endl; 12 \quad\quad return 0; 13 \quad } 14 15 void showDub(int num) 16 { 17 cout << (num * 2) << endl; 18 }

(Multiple Choice)
4.9/5
(78)

Look at the following function prototype. int myFunction(double); What is the data type of the funtion's return value?

(Multiple Choice)
4.8/5
(96)

A(n) _________ is information that is passed to a function, and a(n) _________ is information that is received by a function.

(Multiple Choice)
4.9/5
(58)

Which of the following statements about global variables is true?

(Multiple Choice)
4.7/5
(82)

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

(True/False)
4.8/5
(78)
Showing 41 - 49 of 49
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)