Choose the correct answer
1. Which of the following is a valid prototype for a function that accepts an integer argument and
returns a double value?
a. int function (double);
b. int function (double)
c. double function (int);
d. double function (int)
Study the function header below:
double getResults(double fN, double sN)
2. Which of the following is a valid function prototype for the header?
a. getResults(double firstnum1, double num2);
b. double (double num1, double num2);
c. double getResults(double, double);
d. results = getResults(num1, num2);
3. What value is returned by the following return statement?
int x = 5;
return x / 2;
a. 2
b. 2.5
c. 2.1
d. nothing
1. C
2. C
3. D
Comments
Leave a comment