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 full form nasa?

0 Answers  


There is a array of 99 cells and we have to enter 1-100 elements in it , no two elements would repeat , so the is one no. missing because 99 cells and 1-100 nos. so we had to implement a function to find that missing no.

2 Answers   Nagarro,


What is the difference between ++ count and count ++?

0 Answers  


write a programming using for loop in c++ to generate diamond trangel?

1 Answers   NIIT,


In c++, what is the difference between method overloading and method overriding?

0 Answers  






What are the uses of static class data?

0 Answers  


What is the auto keyword good for in c++?

0 Answers  


Difference between const char* p and char const* p?

1 Answers  


write a program that will produce the ff. output. "what fruit will you buy? 1)apple 2)orange 3)mango ENTER CHOICE (1,2 or 3)> HOW MANY WILL YOU BUY?> THAT WILL COST XX.XX

1 Answers  


Can we delete this pointer in c++?

0 Answers  


What is the rule of three?

0 Answers  


Is there anything you can do in C++ that you cannot do in C?

1 Answers  


Categories