#include<iostream.
h>
#include<conio.h>
int count = 0;
class Test
{
public :
Test()
{
count++;
cout<<"\n Object Created Number : "<<count;
}
~Test()
{
cout<<"\n Object Destroyed Number :"<<count;
count--;
}
};
int main()
{
clrscr();
cout<<"\n Inside Main";
Test t1; //constructor for t1 count = 1
{
cout<<"\n Inside Block";
Test t2,t3; //constructor for t2 and t3 count=2 and count =3
cout<<"\n Exit from Block";
} //destructor for t2 and t3 count=3 count =2
cout<<"\n Inside Main Again";
Test t4;//constructor for t4 count =2
cout<<"\n Exit from main";
getch();
return 0;
} //destructor for t1 and t4 count =2 count=1