### inputing more than one prototype in program not working?

so i have to write a average programming using an int and double prototype calling the function with va_list but for some reason no matter how I write the program the read on the second list for double outputs the way wrong answer something like -3.4223423e^-007 so can anyone tell me what i am doing wrong?
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748`` ``````#include using std::cout; using std::endl; #include // function prototype(s) int avg(int, ...); // return average of a variable length list of integers int avg(int n, ...)// "n" is the number of numbers in the list; "..." is the list { va_list list; // assign the name "list" to the variable length list of integers va_start(list, n); // tell C++ that the list begins AFTER the parameter "n" int num; // store the numbers from the list in "num" as they are "read" // create the total of "n" numbers in the list int total = 0; // track the total of the numbers in the list for (int i = 0; i < n; i++) { num = va_arg(list, int); // set num equal to the next number in the list, as an int total = total + num; // increment the total } va_end(list); // close the list -- REQUIRED // compute and return the average return total / n; } double davg(int, ...); double davg(int n, ...) { va_list list; double sum2 = 0.0; int total1 = 0; va_start (list, n); for (int x = 0; x < n; x++) { sum2 = va_arg(list, double); total1 = total1 + sum2; } va_end(list); total1 = total1 / n; return total1; } int main() { cout << "The average of 5 test scores is " << avg(5, 81, 92, 73, 84, 95) << endl; cout << "The average of 5 test scores is " << davg(56.8, 87.9, 99.2, 76.5, 85.3) << endl; }``````
`davg(3, 1.618, 2.7183, 3.141592);` the first parameter is the number of items.