#include<iostream.h>
#include<conio.h>
class employee
{
int
emp_id;
char
name[25],post[30];
public:
void
read();
void
print();
};
void employee::read()
{
cout<<"Enter employee id\n";
cin>>emp_id;
cout<<"Enter employee name\n";
cin>>name;
cout<<"Enter employee post\n";
cin>>post;
}
void employee::print()
{
cout<<"\n\nID\tNAME\tPOST\n";
cout<<emp_id<<"\t"<<name<<"\t"<<post<<endl;
}
void main()
{
clrscr();
employee e; // object creation
e.read(); //read function call
e.print(); //print function call
getch();
No comments:
Post a Comment