Program 3

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

#include <stdio.

h>

#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

typedef struct emp{

int id;

char name[50];

int salary;

};

int main(int argc, char *argv[]) {

struct emp e[50];

int i;

int n;

printf("Enter Numbers of Employees:");

scanf("%d",&n);

printf("Accept Emp Data:\n");

for(i=0;i<n;i++){

printf("Enter Employee Id%d",i+1);

scanf("%d",&e[i].id);

printf("Enter Employee Name%d",i+1);

scanf("%s",&e[i].name);

printf("Enter Employee Salary%d",i+1);

scanf("%d",&e[i].salary);
}

printf("Details Of Employee\n\n");

void Display(struct emp e[50]){

int i;

for(i=0;i<n;i++){

if(e[i].salary>10000){

printf("Employee Id:%d\n",e[i].id);

printf("Employee Name:%s\n",e[i].name);

printf("Employee Salary:%d\n",e[i].salary);

Display(e);

return 0;

You might also like