








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









#include <iostream.h> #include <conio.h> class Number { private: int n,m; public: Number() //Default Constructor Explicit Definition { n = m = 100; } Avg() { cout<<“Average of two numbers=”<<(n+m)/2; } }; void main() { Number x; x.avg(); getch(); }
#include<iostream.h> #include<conio.h> class Foo { private: int data; public: Foo() //constructor { cout<<”Object Created”<<endl; } ~Foo() //destructor { cout<<”Object Destroyed”<<endl; } }; int main() { Foo f1,f2; return 0; }