Ask Question
17 March, 01:35

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

+1
Answers (1)
  1. 17 March, 02:16
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers