ExamVeda
Login
Home
71
Which operator is used to access the nth bit in a bitset?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
72
What will be the output of the following C++ code?
#include <stdexcept>
#include <limits>
#include <iostream>
using namespace std;
void MyFunc(char c)
{
    if (c < numeric_limits<char>::max())
        return invalid_argument;
}
int main()
{
    try
    {
        MyFunc(256);
    }
    catch(invalid_argument& e)
    {
        cerr << e.what() << endl;
        return -1;
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
73
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
template <class T>
class A
{
    public:
    A(int a): x(a) {}
    protected:
    int x;
};
template <class T>
class B: public A<char>
{
    public:
    B(): A<char>::A(100) 
    {
        cout << x * 2 << endl;
    }
};
int main()
{
    B<char> test;
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
74
What is meant by sequence point?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
75
Where does the member should be defined if it is used in the program?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
76
What will be the output of the following C++ code?
#include <iostream>
using namespace std;  
template<int n> 
struct funStruct
{
    static const int val = 2*funStruct<n-1>::val;
};
 
template<> 
struct funStruct<0>
{
    static const int val = 1 ;
};
 
int main()
{
    cout << funStruct<10>::val << endl;
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
77
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void square (int *x)
{
    *x = (*x + 1) * (*x);
}
int main ( )
{
    int num = 10;
    square(&num);
    cout << num;
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
78
What will be the output of the following C++ code?
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main ()
{
    srand (time(NULL));
    printf ("Random number: %d\n", rand() % 100);
    srand (1);
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
79
What is the use of get() function in tuples?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
80
What is the difference between begin() and rbegin()?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board