ExamVeda
Login
Home
41
Which of the following operator cannot be overloaded?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
42
Pick the correct statement.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
43
Which is used to define the member of a class externally?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
44
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
ostream & operator<<(ostream & i, int n)
{
    return i;
}
int main()
{
    cout << 5 << endl;
    cin.get();
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
45
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
class Box{
    int capacity;
    bool operator<(Box b){
	return this->capacity < b.capacity ? true : false;
    }
public:
    Box(){}
    Box(double capacity){
	this->capacity = capacity;
    }
};
int main(int argc, char const *argv[])
{
    Box b1(10);
    Box b2 = Box(14);
    if(b1 < b2){
	cout<<"Box 2 has large capacity.";
    }
   else{
	cout<<"Box 1 has large capacity.";
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
46
Which operator a pointer object of a class uses to access its data members and member functions?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
47
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main ()
{
    int a, b;         
    a = 10;           
    b = 4;            
    a = b;           
    b = 7;           
    cout << "a:";
    cout << a;
    cout << " b:";
    cout << b;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
48
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
  std::string str ("Example.");
  str.back() = '!';
  std::cout << str << endl;
  return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
49
Which is the correct example of a unary operator?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
50
In case of non-static member functions how many maximum object arguments a binary operator overloaded function can take?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board