ExamVeda
Login
Home
61
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void print(int i)
{
    cout << i;
}
void print(double  f)
{
    cout << f;
}
int main(void)
{
    print(5);
    print(500.263);
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
62
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
#define SquareOf(x) x * x
int main()
{
    int x;
    cout << SquareOf(x + 4);
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
63
Pick the incorrect statement for namespaces in C++.
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
64
What will be the output of the following C++ code?
#include <iostream>
#include <stdarg.h>
using namespace std;
int add (int num, ...)
{
    int sum = 0;
    va_list args;
    va_start (args,num);
    for (int i = 0; i < num; i++) 
    {
        int num = va_arg (args,int);
        sum += num;
    }
    va_end (args);
    return sum;
}
int main (void)
{
    int total = add(8, 1, 2, -1, 4, 12, -2, 9, 7);
    cout << "The result is " << total;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
65
What will happen when the exception is not caught in the program?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
66
What should be passed in parameters when function does not require any parameters?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
67
How many types do functions fall depends on modularization?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
68
What will be the output of the following C++ code?
#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);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
69
Which keyword is used to access the variable in the namespace?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
70
Where can the default parameter be placed by the user?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board