Vidyalelo
C++ Programming · Q933

C++ miscellaneous

Programming · C++ Programming · question 933

Q933

What will be the output of the following C++ code? #include #include using namespace std; float avg( int Count, ... ) va_list Numbers; va_start(Numbers, Count); int Sum = 0; for (int i = 0; i < Count; ++i) Sum += va_arg(Numbers, int); va_end(Numbers); return (Sum/Count); int main() float Average = avg(10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); cout << Average; return 0;

A.
4
Answer
B.
5
C.
6
D.
compile time error

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board