KodeGod.com

095. Define a structure Employee having elements emp_id, name,etc. Accept data and reprint it

#include<stdio.h>
#include<conio.h>  

struct Employee
{
 char name[50];
 int emp_id;
 long phone_no;
};

main()
{
	struct Employee e;
	clrscr();
	printf("Enter name : ");
	scanf("%s",&e.name);
	printf("Enter emp_id: ");
	scanf("%d",&e.emp_id);
	printf("Enter Phone Number: ");
	scanf("%ld",&e.phone_no);

	printf("\n\nEnter name : %s",e.name);
	printf("\n\nEnter Emp Id       : %d",e.emp_id);
	printf("\n\nEnter Phone Number : %ld ",e.phone_no);

	getch();
}