C Program to Read Salaries of 200 Employees and Read Salary

0
7
digitalample eye
Write a C program to read salaries of 200 employees and count the number of employees getting a salary between 5000 – 10000.

C Program to Read Salaries of 200 Employees and Read Salary.

Source Code,

include <stdio.h>
#include <conio.h>
void main()
{
int sal[200],i,count=0;
clrscr();
for(i=0;i<200;i++)
{
printf("Enter the salary:");
scanf("%d",&sal[i]);
}
for(i=0;i<200;i++)
{
if(sal[i]>=5000 && sal[i]<=10000)
count=count+1;
}
printf("No of employees getting salary between 5000-10000=%d",count);
getch();
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here