OBJECT

Home >> Sem 2 >> C++ programs >> OBJECT

#include<iostream.h>
#include<conio.h>
class test
{
   int a,b;
   public:
     test()
      {
       a=b=5;
      }
  void get(test &t)
   {
    t.a = t.a + t.b;
   }
  void show()
   {
    cout<<a<<endl;
   }
};
void main()
 {
 clrscr();
  test t,t1;
  t.get(t1);
  t1.show();
  t.show();
  getch();
}