Structure1


#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);
}

Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

Random Posts