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().

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is empty stack c++?

732


How many types of scopes are there in c++?

798


Can I learn c++ as my first language?

855


Does dev c++ support c++ 11?

759


What is microsoft c++ redistributable 2013?

799


What is constant in c++ with example?

859


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

947


What is a volatile variable in c++?

1017


Explain the difference between static and dynamic binding of functions?

807


How does java differ from c and c++?

728


How will you call C functions from C ++ and vice-versa?

867


Write a short code using c++ to print out all odd number from 1 to 100 using a for loop

799


What are c++ data types?

891


What is function declaration in c++ with example?

743


Where must the declaration of a friend function appear?

743