You are on page 1of 1

/* Array of Structures */

#include<iostream.h> #include<conio.h> #include<stdio.h> struct emp { int eno ; char ename[50],edesig[50] ; }ep[50] ; void main( ) { clrscr( ) ; int i,size ; cout<<"Enter the number of entries of employees (max. 50) : " ; cin>>size ; for(i=0 ; i<size ; i++) { cout<<"Enter employee number : " ; cin>>ep[i].eno ; cout<<"Enter employee name : " ; gets(ep[i].ename) ; cout<<"Enter designation : " ; gets(ep[i].edesig) ; cout<<" \n " ; } cout<<endl ; for(i=0 ; i<size ; i++) { cout<<" \n Employee Number : "<<ep[i].eno ; cout<<" \n Employee Name : " ; puts(ep[i].ename) ; cout<<"Designation : " ; puts(ep[i].edesig) ; } getch( ) ; }

You might also like