Ask Question

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);

+5
Answers (1)
  1. 2 September, 16:48
    0
    The answer is "Option c"

    Explanation:

    In the given function code, a TotalAmount function is declared, which includes three-parameter, which are "integer, float, and string", and 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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of the following is a valid function prototype for the following function definition? void TotalAmount (int a, float &b, string ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers