We provide Engineering,HSEB notes, tutorials which can be helpful for students during college life.
Tuesday, April 7, 2015
44. Write a program to read salaries for 300 employees and count the number of employees getting salary from 10,000 to15,000.
#include <stdio.h>
#include <conio.h>
void main()
{
int salary[300],i,n,count=0;
clrscr();
printf("\n Input salary of 300 persons:- ");
for(i=0;i<300;i++)
scanf("%d",&salary[i]);
for(i=0;i<300;i++)
{
if(salary[i]>10000 && salary[i]<15000)
count++;
}
printf("There are %d persons whose salary is in between 10000 and 15000",count);
getch();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment