A
Q. What is the output of this program?
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);
}
#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);
}
- Correct Answer - Option(D)
- Views: 40
- Filed under category C++
- Hashtags:
Discusssion
Login to discuss.