CONST - } void main() { clrscr (); ab a1,a2(4),a3(6,7);

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> class ab { int a,b; public: ab(); ab (int,int y=2); int add(); }; ab::ab() { a=2; b=3; } ab::ab(int x,int y) { a=x; b=y; } int ab::add() { return (a+b);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } void main() { clrscr (); ab a1,a2(4),a3(6,7); cout&lt;&lt;a1.add()&lt;&lt;endl; cout&lt;&lt;a2.add()&lt;&lt;endl; cout&lt;&lt;a3.add()&lt;&lt;endl; getch(); }...
View Full Document

Ask a homework question - tutors are online