Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.Write the prototype of a function called \"sub\" that take two variables x, y

ID: 3677702 • Letter: 1

Question

1.Write the prototype of a function called "sub" that take two variables x, y of type double and return another double.

2.

void display(string v)

{

cout << " Inside display " << v << endl;

return 0;

}

What is wrong with the code above?

The name of the function is a reserved word.

void need to be removed.

cout needs to be replaced by cin

It is a void function, trying to return 0, an integer.

A.

The name of the function is a reserved word.

B.

void need to be removed.

C.

cout needs to be replaced by cin

D.

It is a void function, trying to return 0, an integer.

Explanation / Answer

1)double sub(double x,double y);

It is a void function, trying to return 0, an integer.

2)D.

It is a void function, trying to return 0, an integer.