Which of the following is a valid function prototype for the following function definition?

void TotalAmount(int a, float &b, string name); { //........... }

a)void TotalAmount(int, float, string);

b)void TotalAmount(int &, float &, string &);

c)void TotalAmount(int, float &, string);

Respuesta :

In the given function code, a TotalAmount function is declared, which includes three-parameter, which are "integer, float, and string", and the function return type is void, which means, it doesn't return any value.

  • In these parameters a float variable is a reference type, that uses "&", that's why it is correct and other options were not correct, that can be explained as follows:
  • In option a, In this function parameter, a variable is not a reference type variable, that's why it is not correct.
  • In option b, In this function, all parameter value is a reference type that's why it is not correct.

Therefore, the final answer is "Option c".  

Learn more:

brainly.com/question/14212488

ACCESS MORE