ExamVeda
Login
Home
31
What will be the output of the following C++ code?
#include<iostream>
#include<stdlib.h>
using namespace std; 
template<class T, class U, class V=double>
class A  
{
    T x;
    U y;
    V z;
};
 
int main()
{
   A<int, int> a;
   A<double, double> b;
   cout << sizeof(a) << endl;
   cout << sizeof(b) << endl;
   return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
32
When does the next sequence point start?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
33
What will be the output of the following C++ code?
#include <iostream>
#include <queue>
using namespace std;
int main ()
{
    queue<int> myqueue;
    int sum (0);
    for (int i = 1; i <= 10; i++) 
        myqueue.push(i);
    while (!myqueue.empty())
    {
        sum += myqueue.front();
        myqueue.pop();
    }
    cout << sum << endl;
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
34
Which header file is used to manipulate the allocater?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
35
What kind of functions are min and max in c++?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
36
What will be the output of the following C++ code?
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
    srand((unsigned)time(0));
    int ran;
    int low = 1, high = 10;
    int range = (high - low) + 1;
    for(int index = 0; index < 1; index++)
    {
        ran = low + int(range * rand() / (RAND_MAX + 1.0));
        cout << ran << endl;
    }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
37
Which of the following header file is required for forwawrd_list?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
38
Pick out the correct statement about multiple inheritances.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
39
Which operator is used to compare the elements in heap?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
40
Which of the following is correct to interpret Hello World as a single argument?
1. $ ./output 'Hello World'
2. $ ./output Hello World
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board