Exam 6: Functions
Exam 1: Introduction to Computers and Programming44 Questions
Exam 2: Introduction to C++56 Questions
Exam 3: Expressions and Interactivity44 Questions
Exam 4: Making Decisions53 Questions
Exam 5: Loops and Files62 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays53 Questions
Exam 8: Searching and Sorting Arrays20 Questions
Exam 10: Characters, C++-Strings, and More About the String Class42 Questions
Exam 11: Structured Data43 Questions
Exam 11: Structured Data50 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes46 Questions
Exam 14: More About Classes40 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions38 Questions
Exam 16: Exceptions, Templates, and the Standard Template Library STL39 Questions
Exam 17: Linked Lists40 Questions
Exam 18: Stacks and Queues46 Questions
Exam 19: Recursion21 Questions
Exam 20: Binary Trees38 Questions
Select questions type
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()
{
int x = 2;
showDub(x);
cout << x << endl;
return 0;
}
void showDub(int num)
{
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)
Which line in the following program contains the prototype for the showDub function?
1 #include <iostream>
2 using namespace std;
3
4 void showDub(int);
5
6 int main()
7 {
8 int x = 2;
9
10 showDub(x);
11 cout << x << endl;
12 return 0;
13 }
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)