ExamVeda
Login
Home
11
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class numbers
{
    private:
    int m_nValues[10];
    public:
    int& operator[] (const int nValue);
};
int& numbers::operator[](const int nValue)
{
    return m_nValues[nValue];
}
int main()
{
    numbers N;
    N[5] = 4;
    cout <<  N[5];
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
12
Pick out the correct statement.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
13
What is the return type of the conversion operator?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
14
Which functions of a class are called inline functions?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
15
What will happen when the function call operator is overloaded?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
16
How many real types are there in complex numbers?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
17
Which of these following members are not accessed by using direct member access operator?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
18
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
    typedef int num;
    typedef char let;
    let w = "steve";
    num a = 10, b = 15;
    num c = a + w;
    cout << c;
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
19
What will be the output of the following C++ code?
#include <iostream> 
#include <string>
using namespace std; 
int main(int argc, char const *argv[])
{
	char str[10];
	cin>>str;
	cout<<str;
	return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
20
When struct is used instead of the keyword class means, what will happen in the program?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board