given the code segment below
void main()
{
cout<<"my no. is";
}
question is how can we get the output hai aravind my no. is
99999999999 without editig the main().

Answers were Sorted based on User's Feedback



given the code segment below void main() { cout<..

Answer / pankaj rathor

#include <iostream>

using namespace std;

class dummy
{
public:
dummy()
{
cout<<"Hai Arvind ";
}

~dummy()
{
cout<<" 99999999999";
}
};

dummy obj;

int main()
{
cout<<"my no. is";
return 0;
}

Is This Answer Correct ?    15 Yes 2 No

given the code segment below void main() { cout<..

Answer / sunil chopra

Overload the << operator.

ostream& operator << (ostream& ot, const char* chr)
{
using std::operator<<;
return ot << "Hai Arvind " << chr << " 99999999999";
}

Is This Answer Correct ?    9 Yes 2 No

Post New Answer

More C++ General Interview Questions

How come you find out if a linked-list is a cycle or not?

0 Answers  


How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever

17 Answers   Datavance, Quark, VEL, Wipro,


class Foo { public: Foo(int i) { } }; class Bar : virtual Foo { public: Bar() { } }; Bar b; Referring to the above code, when the object 'b' is defined, a compiler error will occur. What action fixes the compiler error? a) Adding a virtual destructor to the class Bar b) Adding a constructor to Bar which takes an int parameter c) Adding "Foo()" to the Bar constructor d) Adding a copy constructor to the class Foo e) Adding "Foo(0)" to the Bar::Bar initializer list

2 Answers   Quark,


What language does google use?

0 Answers  


What are advantages and disadvantages of Design patterns?

7 Answers   IBM, Vodafone,


what Is DCS ? what i will get benefit when i did?

0 Answers  


What is overloading unary operator?

0 Answers  


how many trys can we write in one class

3 Answers   Cap Gemini,


Will this c++ program execute or not?

0 Answers  


What is c++ virtual inheritance?

0 Answers  


describe private access specifiers?

0 Answers  


What is boyce codd normal form in c++?

0 Answers  


Categories