ExamVeda
Login
Home
81
What are the containers?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
82
What is the header file used for declaring the standard library algorithms?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
83
What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main () 
{
    int myints[] = {10, 20, 30, 30, 20, 10, 10, 20};
    int mycount = count (myints, myints + 8, 10);
    cout << "10 appears " << mycount << " times.\n";
    vector<int> myvector (myints, myints+8);
    mycount = count (myvector.begin(), myvector.end(), 20);
    cout << "20 appears " << mycount  << " times.\n";
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
84
What will be the output of the following C++ code?
#include <stdio.h>
#include <stdlib.h>
int main ()
{
    div_t divresult;
 
    divresult = div (38, 5);
    printf ("%d\n", divresult.rem);
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
85
What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main () 
{
    vector<int> myvector (4);
    fill (myvector.begin(), myvector.begin() + 2, 3);
    fill (myvector.begin() + 1, myvector.end() - 1, 4);
    for (vector<int> :: iterator it = myvector.begin(); it != myvector.end(); ++it)
        cout << ' ' << *it;
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
86
What are Iterators?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
87
What will be the output of the following C++ code?
#include <typeinfo>
#include <iostream>
using namespace std;
class Test
{
    public:
    Test();
    virtual ~Test();
};
int main()
{
    Test *ptrvar = NULL;
    try 
    {
        cout << typeid(*ptrvar).name() << endl;
    }
    catch (bad_typeid) 
    {
        cout << "The object is null" << endl;
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
88
What will be the output of the following C++ code?
#include <iostream> 
#include <algorithm>
using namespace std;
int main () 
{
    int myints[] = {10, 20, 30, 30, 20, 10, 10, 20};  
    int* pbegin = myints;                      
    int* pend = myints + sizeof(myints) / sizeof(int);
    pend = remove (pbegin, pend, 20);      
    for (int* p = pbegin; p != pend; ++p)
        cout << ' ' << *p;
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
89
What is meant by vector in the container library contains?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
90
How many macros are used by mathematical functions in the header file <cerrno>?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board