Chapter 6 C++ GRADE A QUESTIONS WITH
ANSWER
A(n) ________ argument is passed to a parameter when the actual argument is left out
of the function call. - (correct answer)default
A function ________ eliminates the need to place a function definition before all calls to
the function. - (correct answer)prototype
This is a statement that causes a function to execute. - (correct answer)function call
EXIT_FAILURE and ________ are named constants that may be used to indicate
success or failure when the exit( ) function is called. - (correct answer)EXIT_SUCCESS
What is the output of the following program?
#include <iostream>
using namespace std;
int getValue (int);
int main()
{
int x= 2;
cout<< getValue (x)<< endl;
return 0;
}
int getValue (int num)
{
, return num +5;
} - (correct answer)7
In a function header, you must furnish:
1) data types of the parameters
2) the name of function
3) names of parameter variables
4) data type of the return value
5) all of these - (correct answer)all of these
A(n) ________ is information that is passed to a function, and a(n) ________ is
information that is received by a function. - (correct answer)argument, parameter
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;
return0;
ANSWER
A(n) ________ argument is passed to a parameter when the actual argument is left out
of the function call. - (correct answer)default
A function ________ eliminates the need to place a function definition before all calls to
the function. - (correct answer)prototype
This is a statement that causes a function to execute. - (correct answer)function call
EXIT_FAILURE and ________ are named constants that may be used to indicate
success or failure when the exit( ) function is called. - (correct answer)EXIT_SUCCESS
What is the output of the following program?
#include <iostream>
using namespace std;
int getValue (int);
int main()
{
int x= 2;
cout<< getValue (x)<< endl;
return 0;
}
int getValue (int num)
{
, return num +5;
} - (correct answer)7
In a function header, you must furnish:
1) data types of the parameters
2) the name of function
3) names of parameter variables
4) data type of the return value
5) all of these - (correct answer)all of these
A(n) ________ is information that is passed to a function, and a(n) ________ is
information that is received by a function. - (correct answer)argument, parameter
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;
return0;