186k views
0 votes
What does the following function return? double compute speed(double distance); A. a double B. distance C. an integer D. nothing

User CPR
by
5.1k points

1 Answer

1 vote

Answer:

A. a double

Step-by-step explanation:

The syntax of the function is:

type name( argument_1, argument_1,...... )

{

statement;

}

In the above syntax "type" define the return type of the function.

for example:

int count( int n);

so, it return the integer. Because the return type is 'int'.

In the question,

double compute speed(double distance);

Here, the return type is double. So, it return double.

User Tom Van Der Woerdt
by
5.1k points