Ask Question
2 May, 02:23

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

+3
Answers (1)
  1. 2 May, 05:44
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers