Class Example

#include<iostream.h>
#include<conio.h>


class emp
{
char empname[20];
int empno;
float basic,hra,da,netpay;
public:
void read()
{
cin>>empname>>empno>>basic>>hra>>da;
netpay=basic+hra+da;
}
void out()
{
cout<<"Name"<<empname;
cout<<"Employee No."<<empno;
cout<<"NetPay"<<netpay;
}
};
void main()
{
emp e[10];
for(int i=0;i<10;i++)
    {
    cout<<"Enter the details of"<<i+1<<"Employee";
    e[i].read();
    }
for(i=0;i<10;i++)
    {
    cout<<"Details of"<<i+1<<"Employee";
    e[i].out();
    }
getch();
}