Pages

Wednesday, March 26, 2014

C Program To count age of employee above the age of 50

/* to count number of employee of age above 50*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int i, n,age[25],count=0;
    printf("How many employee?");
    scanf("%d",&n);
    printf("enter age of %d employee:",n);
    for (i=0;i<n;i++)
        scanf("%d",&age[i]);
    for(i=0;i<n;i++)
    {
        if(age[i]>50)
            count++;
    }
    printf("\n no. of employee of age above 50=%d",count);
    system("pause");
    return 0;
}

No comments:

Post a Comment