#include<iostream.h> #include<conio.h> class employee { char name[20]; int day,month,year; public: employee() { cout<<"Enter Name:"; cin>>name; cout<<"Enter Day:"; cin>>day; cout<<"Enter Month:"; cin>>month; cout<<"Enter Year:"; cin>>year; } void display() { cout<<"Employee Name:"<<name<<endl; cout<<"Date:"<<day<<"-"<<month<<"-"<<year<<endl; } }; void main() { int i,j,k; clrscr(); employee tmp; employee *e=new employee[5]; for(i=0;i<5;i++) { for(j=0;j<=i-1;j++) { if(e[j]>e[j+1]) { tmp=e[j]; e[j]=e[j+1]; e[j+1]=tmp; } } } for(k=0;k<5;k++) { e->display(); } // e->display(); getch(); }
cout
cin
employee
main
sort
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)