adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <stdarg.h>
    using namespace std;
    void fun(std::string msg, ...);
    int main()
    {
        fun("IndiaBIX", 1, 4, 7, 11, 0);
        return 0;
    }
    void fun(std::string msg, ...)
    {
        va_list ptr;
        int num;
        va_start(ptr, msg);
        num = va_arg(ptr, int);
        num = va_arg(ptr, int);
        cout << num;
    }

a.

6

b.

5

c.

8

d.

4

Answer: (d).4

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?