#include<iostream.h>
#include<stdio.h>
#include<conio.h>
class
subscriber
{ char
name [20] ;
long int phone;
public :
void read_data ()
{
cout<<"Enter name
phone number of 50 students:";
gets (name);
cin>>phone;
}
void print_data ()
{
cout<<name<<"\t"<<phone<<"\n";
}
};
void main (
)
{
subscriber
ob [50] ;
for (int
i=0;i<50;i++)
ob [i]. read_data ( ) ;
for
(i=0;i<50;i++)
ob [i]. print_data ( ) ;
getch();
}
No comments:
Post a Comment