Pass a structure given as below to a function, to get the data from user and display the data by passing that structure to another function.
Struct employee
{char name[30];
int empcode;
};
#include<conio.h>
#include<stdio.h>
struct employee
{
int employee;
char name[30];
};
struct employee new1();
void list(struct employee age);
void main (void)
{
clrscr();
struct employee g;
g=new1();
list(g);
getche();
}
struct employee new1()
{
struct employee g;
printf(“Enter Your Name: “);
gets(g.name);
printf(“Enter Your Employee No: “);
gets(“%d”,&g.employee);
return(g);
}
void list(struct employee age)
{
clrscr():
printf(“My Name is %s\n”, age.name);
printf(“Employee Code: %d\n”,age.employee);
}