To display the salary of the employees | SoloLearn: Learn to code for FREE!

0

To display the salary of the employees

Can anyone check and help me with the code if any error or mistake is there or no https://code.sololearn.com/cm444wUimonT/?ref=app

c

1/21/2021 7:13:21 AM

Sumit Mistri

1 Answer

New Answer

+1

"Looks like you are still using old Turbo C." // Created by Sumit Mistri #include<stdio.h> int main() { char g; int yos , qual , sal=0; 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) printf("sal = 15000"); else if(g=='m' && yos>=10 && qual==0) printf("sal = 14000"); else if( g=='m' && yos<10 && qual==1) printf("sal = 10000"); else if( g=='m' && yos<10 && qual==0) printf("sal = 7000"); else if( g=='f' && yos>=10 && qual==1) printf("sal = 12000"); else if( g=='f' && yos>=10 && qual==0) printf("sal = 9000"); else if( g=='f' && yos<10 && qual==1) printf("sal = 10000"); else if( g=='f' && yos<10 && qual==0) printf("sal = 6000"); printf("Salary of Employee=%d\n" , sal); return 0; }