ExamVeda
Login
Home
31
Which of the things does not require instantiation?
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>
#include <string>
#include <sstream>
using namespace std;
int main ()
{
    string mystr;
    float price = 0;
    int quantity = 0;
    cout << "Enter price: ";
    getline (cin, mystr);
    stringstream(mystr) >> price;
    cout << "Enter quantity: ";
    getline (cin, mystr);
    stringstream(mystr) >> quantity;
    cout << "Total price: " << price * quantity << endl;
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
33
Which of the following can derived class inherit?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
34
Which interface determines how your class will be used by another program?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
35
What is the use of the function "showbase"?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
36
How many runtime error messages associated with exception?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
37
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
    try
    {
        try
        {
            throw 20;
        }
        catch (int n)
        {
            cout << "Inner Catch\n";
        }
    }
    catch (int x)
    {
        cout << "Outer Catch\n";
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
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 <vector>
using namespace std;
int main ()
{
    vector<int> a (3, 0);
    vector<int> b (5, 0);
    b = a;
    a = vector<int>();
    cout << "Size of a " << int(a.size()) << '\n';
    cout << "Size of b " << int(b.size()) << '\n';
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
39
What will be the output of the following C++ code?
#include <iostream>
using namespace std; 
template <typename T>
void fun(const T&x)
{
    static int count = 0;
    cout << "x = " << x << " count = " << count;
    ++count;
    return;
}
 
int main()
{
    fun<int> (1); 
    cout << endl;
    fun<int>(1); 
    cout << endl;
    fun<double>(1.1);
    cout << endl;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
40
Which of the following is the correct syntax of accessing the first element of a pair p?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board