Wednesday

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

#include<stdio.h>
#include<conio.h>
void main()
  {
    int i,c=0;
    float s[200];
    clrscr();
    printf("\nEnter salaries for 200 employees");
    for(i=0;i<200;i++)
     scanf("%f",&s[i]);
    for(i=0;i<200;i++)
    {
      if (s[i]>5000 && s[i]<10000)
            c=c+1;
    }
    printf("Total number of employees getting salary between 5000 and 10000 are %d",c);

     getch();
 }

No comments:

Post a Comment

Rahul-Notes