adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <stdarg.h>
    using namespace std;
    void dumplist(int, ...);
    int main()
    {
        dumplist(2, 4, 8);
        dumplist(3, 6, 9, 7);
        return 0;
    }
    void dumplist(int n, ...)
    {
        va_list p;
        int i;
        va_start(p, n);
        while (n-->0) 
        {
            i = va_arg(p, int);
            cout << i;
        }
        va_end(p);
    }

a.

2436

b.

48697

c.

1111111

d.

compile time error

Answer: (b).48697

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?