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

What is the difference between global variables and local variable

0 Answers  


make a middle node of doubly linklist to the top of the list

1 Answers  


What is the difference between interpreters and compilers?

0 Answers  


What is a character in c++?

0 Answers  


What is else syntax in c++?

0 Answers  






What happens when you make call 'delete this;'?

0 Answers  


Tell me can a pure virtual function have an implementation?

0 Answers  


Can a constructor throw a exception? How to handle the error when the constructor fails?

1 Answers  


What are built-in functions? What is the syntax for the definition?

0 Answers  


What are the 4 types of library?

0 Answers  


What is the difference between an enumeration and a set of pre-processor # defines?

0 Answers  


What is the default width for ouputting a long integer using the insertion operator?

0 Answers  


Categories