Back To C Structures
//program to create a structure employee with members (ecode,ename,salary and designation) and input values from user and then display the values #include
#include
struct employee { int ecode; char ename[20]; float salary; char designation[20]; }; void main() { struct employee emp; clrscr(); printf("enter ecode of employee "); scanf("%d",&emp.ecode); printf("enter name of employee "); scanf("%s",emp.ename); printf("enter salary of employee"); scanf("%f",&emp.salary); printf("enter designation of employee"); scanf("%s",emp.designation); printf("\ndisplaying the values \n"); printf("\necode of employee is %d",emp.ecode); printf("\nname of employee is %s",emp.ename); printf("\nsalary of employee is %f",emp.salary); printf("\ndesignation of employee is %s",emp.designation); getch(); }