E11THSPT - } }; } void main() { clrscr(); person

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> #include<string.h> # class person { char name[30]; float age; public: person(char*s,float a) { strcpy(name,s); age=a; } { if(x.age>=age) { return (x); } else { return(*this); } } void display() { cout<<"\nname "<<name<<"\nage "<<age;
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(); person p1(&quot;xyz&quot;,37.5); person p2(&quot;abc&quot;,29.0); person p3(&quot;pqr&quot;,40.25); person p=p1.greater(p3); p.display(); p=p1.greater(p2); p.display(); getch(); }...
View Full Document

Ask a homework question - tutors are online