ExamVeda
Login
Home
31
To what type of object does the container can be instantiated?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
32
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
   int var = -12;
   try {
      cout<<"Inside try\n";
      if (var < 0)
      {
        throw var;
        cout<<"After throw\n";
      }
   }
   catch (char var ) {
      cout<<"Exception Caught\n";
   }
 
   cout<<"After catch\n";
   return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
33
What is Valarray in C++?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
34
What are Distributions in C++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
35
What will be the output of the following C++ code?
#include <cstdlib>
#include <ctime>
#include <iostream>
using namespace std;
int main()
{
    srand((unsigned)time(0));
    int ran;
    for (int i = 0; i < 2; i++)
    {
        ran = (rand() % 10) + 1;
        cout << ran;
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
36
How many parameters are available in srand function?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
37
Which one is used to refer to program elements in any translation units?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
38
What will be the output of the following C++ code?
#include <iostream>
#include <functional>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main () 
{
    vector <string*> numbers;
    numbers.push_back ( new string ("one") );
    numbers.push_back ( new string ("two") );
    numbers.push_back ( new string ("three") );
    vector <int> lengths ( numbers.size() );
    transform (numbers.begin(), numbers.end(), lengths.begin(), 
    mem_fun(&string :: length));
    for (int i = 0; i < 3; i++) 
    {
        cout << lengths[i];
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
39
What can be improved by formatting the source code?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
40
How many types of class relationships are there?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board