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

List the merits and demerits of declaring a nested class in C++?

0 Answers  


Implement strcmp

3 Answers   Bloomberg, Citadel,


Write a Program for find and replace a character in a string.

0 Answers  


What are the four partitions in which c++ compiler divides the ram?

0 Answers  


How does code-bloating occur in c++?

0 Answers  






Define namespace in c++?

0 Answers  


What is c++ runtime?

0 Answers  


Explain the difference between overloading and overriding?

0 Answers  


What are the different types of comments allowed in c++?

0 Answers  


Do class declarations end with a semicolon?

0 Answers  


What is the main use of c++?

0 Answers  


Is there a c++ certification?

0 Answers  


Categories