E11THSPT - void main clrscr person p1"xyz",37.5...

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("xyz",37.5); person p2("abc",29.0); person p3("pqr",40.25); person p=p1.greater(p3); p.display(); p=p1.greater(p2); p.display(); getch(); }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online