Exam 6: Functions
Exam 1: Introduction to Computers and Programming47 Questions
Exam 2: Introduction to C62 Questions
Exam 3: Expressions and Interactivity45 Questions
Exam 4: Making Decisions51 Questions
Exam 5: Loops and Files60 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays and Vectors56 Questions
Exam 8: Searching and Sorting Arrays30 Questions
Exam 9: Pointers47 Questions
Exam 10: Characters, C-Strings, and More About the String Class47 Questions
Exam 11: Structured Data46 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes54 Questions
Exam 14: More About Classes46 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions43 Questions
Exam 16: Exceptions and Templates36 Questions
Exam 17: The Standard Template Library38 Questions
Exam 18: Linked Lists41 Questions
Exam 19: Stacks and Queues47 Questions
Exam 20: Recursion27 Questions
Exam 21: Binary Trees39 Questions
Select questions type
Which line in the following program contains a call to the showDub function?
1 #include <iostream>
2 using namespace std;
3 void showDub(int);
4 int main()
5 {
6 int x = 2;
7 showDub(x);
8 cout << x << endl;
9 return 0;
10 }
11 void showDub(int num)
12 {
13 cout << (num * 2) << endl;
14 }
(Multiple Choice)
4.9/5
(37)
A local variable and a global variable may not have the same name within a program.
(True/False)
5.0/5
(40)
These types of arguments are passed to parameters automatically if no argument is provided in the function call.
(Multiple Choice)
4.8/5
(42)
It is good programming practice to __________ your functions by writing comments that describe what they do.
(Multiple Choice)
4.7/5
(40)
When a function is called, flow of control moves to the function's prototype.
(True/False)
4.7/5
(36)
A function __________ contains the statements that make up the function.
(Multiple Choice)
4.9/5
(36)
What will the following code display?
#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
(43)
A function can have no parameters, one parameter, or many parameters and can return __________ value(s).
(Multiple Choice)
4.8/5
(37)
Showing 41 - 49 of 49
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)