Friday, April 10, 2015

12. Write an algorithm and C program to read salaries of 200 employees and count the number of employing getting salary between 5000-10,000.


#include<stdio.h>
#include<conio.h>
void main()
{
int salary[200],i,n,count=0;
clrscr();
printf("\n Input salary of 200 persons:-");
for(i=0;i<200;i++)
scanf("%d",&salary[i]);
for(i=0;i<200;i++)
{
if(age[i]>5000 && age[i]<10000)
count++;
}
printf("There are %d persons whose salary is in between 5000 and 10000",count);
getch();
}

2 comments: