ExamVeda
Login
Home
1
What are binary functors?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
2
Why do we need relationships between classes?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
3
What will be the output of the following C++ code?
#include <iostream>  
#include <utility>
#include <string>
 
using namespace std;
 
int main () 
{
  pair <int,int> p1(1,2);
  pair <int,int> p2(3,4);
  cout<<"Pair(first,second) = ("<<p1.first<<","<<p1.second<<")\n";
  p1.swap(p2);
  cout<<"Pair(first,second) = ("<<p1.first<<","<<p1.second<<")\n";
  return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
4
What is meant by permutation in c++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
5
Which operators are used in the free store?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
6
Which algorithm is used in subtract_with_carry_engine?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
7
What will be the output of the following C++ code?
#include<iostream> 
#include<iterator> 
#include<vector> 
using namespace std; 
int main() 
{ 
    vector<int> ar = { 1, 2, 3, 4, 5 }; 
    vector<int>::iterator ptr = ar.begin(); 
    ptr = next(ptr, 3);
    cout << *ptr << endl; 
    return 0; 
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
8
What will be the output of the following C++ code?
#include <iostream>
#include <exception>
using namespace std;
struct MyException : public exception
{
    const char * what () const throw ()
    {
        return "C++ Exception";
    }
};
int main()
{
    try
    {
        throw MyException();
    }
    catch(MyException& e)
    {
        cout << "Exception caught" << std::endl;
        cout << e.what() << std::endl;
    }
    catch(std::exception& e)
    {
    }    
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
9
What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main () 
{
    vector<int> myvector (5);
    fill (myvector.begin(), myvector.begin() + 4, 5);
    fill (myvector.begin() + 3,myvector.end() - 2, 8);
    for (vector<int> :: iterator it = myvector.begin();
        it != myvector.end(); ++it)
    cout << ' ' << *it;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
10
What will be the output of the following C++ code?
#include <iostream>  
#include <utility>
 
using namespace std;
 
int main () 
{
  pair <int,int> p(1,2);
  cout<<"Pair(first,second) = ("<<p.first<<","<<p.second<<")\n";
  return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board