Write a Program to Calculate the salary of an Employee as per the following Tabel:

Engg.... | 00:30 | | Best Blogger Tips


  Gender Years of Service Qualifications   Salary
  Male      >=10Post-Graduate  15000
     >=10Graduate 10000
      <10Post-Graduate 10000
      <10Graduate  7000
 Female      >=10 Post-Graduate 12000
     >=10 Graduate   9000
      <10Post-Graduate  10000
      <10Graduate   6000


Statement of C Program: Calculate the Salary of an Employee by using the Above Tabel:

#include<stdio.h>
#include<conio.h>
void main()
{
char g;
int yos , qual , sal=0;
clrscr();
printf(" Enter Gender , Years of Service and Qualification ( G=0 , PG=1 ):");
                  /* G stands for Graduate and PG stands for Post-Graduate */
scanf("%c%d%d" , &g , &yos , &qual);

if(g=='m' && yos>=10 && qual==1)
sal = 15000;

else if( (g=='m' && yos>=10 && qual==0) || ( g=='m' && yos<10 && qual==1 ) )
sal = 10000;

else if( g=='m' && yos<10 && qual==0)
sal = 7000;

else if( g=='f' && yos>=10 && qual==1)
sal = 12000;

else if( g=='f' && yos>=10 && qual==0)
sal = 9000;

else if( g=='f' && yos<10 && qual==1)
sal = 10000;

else if( g=='f' && yos<10 && qual==0)
sal = 6000;

printf("Salary of Employee=%d\n" , sal);
getch();
}

Output:
Enter Gender , Years of Service and Qualification ( G=0 , PG=1 ):
f  25  1
Salary of Employee=12000 

                                                             That's All
Please Share it! :)
Do you like this Story?

Get Free Email Updates Daily!

Follow us!

2 comments:

  1. The companion of an evening, and the companion for life, require very different qualifications. See the link below for more info.

    #qualification
    www.ufgop.org

    ReplyDelete
  2. Not more longing to get renowned at this time. Buy Facebook Followers as a method to gain popularity and acceptance on internet in a shorter duration. buy facebook follower

    ReplyDelete