Home / Programming MCQs / C++ MCQs / Question

Code:
#include 
    #include 
    using namespace std;
    void List(int, ...);
    int main()
    {
        List(2, 5, 10);
        List(3, 6, 9, 7);
        return 0;
    }
    void List(int num, ...)
    {
        va_list a;
        int k;
        va_start(a, num);
        while (num-->0) 
        {
            k = va_arg(a, int);
            cout << k;
        }
        va_end(a);
    }
(A) 2 5 10 3 6 9 7
(B) 2 3 5 6 7 9 10
(C) 10 9 7 6 5 3 2
(D) 5 10 6 9 7

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.