Write a program to enter the 20 employee’s name, age, and salary using structure and print them (C program question class 12) .
Solutions :
#include<stdio.h>
struct emp
{
char n[100];
int age;
int sal;
};
struct emp e[20];
int main()
{
int i;
printf("Enter employee name age and salary\n");
for(i=0;i<20;i++)
{
scanf("%s %d %d",e[i].n,&e[i].age,&e[i].sal);
}
printf("Name \t Age \t Salary\n");
for(i=0;i<20;i++)
{
printf("%s\t %d\t %d\t\n",e[i].n,e[i].age,e[i].sal);
}
return 0;
}
OUTPUT :
For more details and query you can directly visit our youtube channel Tukus technology .

Comment your questions
ReplyDelete