#include<stdio.h>
typedef struct { int id;
char name[20];
int salary;
}EMP;
void input(EMP*);
void output(EMP);
void main()
{ EMP employee;
input(&employee);
output(employee);
}
void input(EMP *e)
{ printf("id: ");
scanf("%d",&e->id);
printf("name: ");
fflush(stdin);
gets(e->name);
printf("salary: ");
scanf("%d",&(*e).salary);
}
void output(EMP e)
{ puts("Id\tName\tSalary");
printf("%d\t",e.id);
printf("%s\t",e.name);
printf("%d\t",e.salary);
}
Blogger Comment
Facebook Comment