Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
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
1 Antwort
+ 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;
}