Skip to content

Instantly share code, notes, and snippets.

@easleyschool
Created October 12, 2019 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save easleyschool/91d864e9f00e98256b590d0312cc8709 to your computer and use it in GitHub Desktop.
Save easleyschool/91d864e9f00e98256b590d0312cc8709 to your computer and use it in GitHub Desktop.
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#define NUM_EMPLOYEE 10
int main(int argc, char *argv[]) {
int Salary[NUM_EMPLOYEE], lCount=0, gCount=0, i=0;
printf( "Enter employee salary (Max 10)\n" );
for ( i=0; i<NUM_EMPLOYEE; i++ ) {
printf( "\nEnter employee salary: %d - ", i + 1 );
scanf("%d", &Salary[i] );
}
for( i=0; i<NUM_EMPLOYEE; i++ ) {
if(Salary[i]<3000)
lCount++;
else
gCount++;
}
printf( "\nThere are {%d} employee with salary more than 3000\n", gCount);
printf( "There are {%d} employee with salary less than 3000\n", lCount);
printf( "Press ENTER to continue...\n" );
getchar();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment