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



  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

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

  1. why are we takinng q as int not as char

    ReplyDelete
  2. Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. سلم الرواتب

    ReplyDelete

Popular Posts

Label

1 Sidebar 2 Columns 3 Columns Footer 3rdball 4 Columns Footer Alex Alvaro Antsasia Arlinadesign Averie Barry BASIC CONCEPTS Basil Bayna Fast BeautyPress BeautyTemplates Beckel Best Best - Clean Beyonce Pro BioMag BlackMag Blanter Nova Blogger Card Bloggertheme9 Blogish Bpress Brakt C LANGUAGE C PROGRAMS C++ LANGUAGE C++ PROGRAMS Carella Cellar Charlotte Chooko Lite Clara Clean Combo One Cooperate Crusade Darry Dorman Dreamway Dunia Blanter eCars EduAcademy EducationPress Elise Elvan Eva Everyday FabNews Fashion Fashion Blogger Template Fashion Gossip FastCars Fedo FlashNews Fredy Portfolio Gaming Globus GoodTime Goomsite HTML LANGUAGE iGaming Indicate Innove Insomnia InspiredNews iSoft Jasmine Kalem Landscaping Lashira Lavelle Lily Fashion Limax Linea Lionex Luminescence Lite Lumix Luxury Magazine MagazinePro MAJOR DIFFERENCES MarketingBlog Martin MaxiMag Medica Mega Melissa Mercury MeshMag Minimag Minimalist MiniNews MovieKhor msdesignbd MusicLand Neko NetZine New Spread News16 Newsflash NewsForce NewsIdea Newspaper News NewsPro Nubie Fast Odd Themes Optima PaperMag PaperMag blog Parhlo Perfection Personal Personal Blog Photosout PixelZ Power Blog Premium Themes ProfileMag Purez Rano ReadNews Real estate Remito Grid Responsive Revo Robusta Rotario Saara SeoBoost Settle Shouters Simple Catch SimpleClean Sketchly SNews SolidMag Someo Sophie Sora Sora Bank Sora Home Sora News Responsive Sora One Sora Ribbon Spido Sticko Stucco Sure Mag Swift Tech Tech Pro Techia Techmax TechSpot TemplateClue Templateism Templatesilk Templatesyard Templatezy The Freelancer TheBlogger TheFocus Themeforest Themexpose TIPS AND TRICKS Topside TravelMag Trendy Trendy Travel Tumblr Under Construction Uong Jowo Veethemes Vertox VideoPlay Vigo Waverly way2themes WebBiz Wedding X-Mag Zealer ZetaMag