-->
Showing posts with label WAP to input salary of 'n'number of employees then count total number of employees getting salary in different range. Show all posts
Showing posts with label WAP to input salary of 'n'number of employees then count total number of employees getting salary in different range. Show all posts

WAP to input salary of 'n'number of employees then count total number of employees getting salary in different range

//WAP to input salary of 'n'number of employees then count total number of employees getting salary in different //range
/*
-> less than 5000
 > >=5000 and < 10000
 >  >10000
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,count=0,count1=0,count2=0;
in salary[1000];
printf("enter total number of employees below 1000\n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("enter salary\n");
scanf("%d",&salary[i]);
  if(salary[i]<5000)
   {
     count++;
    }
   else if(salary[i]>=5000 && salary[i]<=10000)
              {
                count1++;
              }
   else
     {
          count2++;
      }
}
printf("total emplyoees getting less than 5000=%d\n",count);
printf("total employees getting more or equals to 5000= and less than 10000=%d\n",count1);
printf("total emplyoees getting more than 10000=%d\n",count2);
getch();
}