Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- int main()
- {
- char gen;
- int yos, sal, qual;
- printf("Enter the gender of the employee. M for male and F for female:");
- scanf(" %c",&gen);
- printf("\nEnter the years of service of the employee: ");
- scanf("%d", &yos);
- printf("\nEnter the qualification of the employee. 0 for graduate and 1 for post-graduate: ");
- scanf("%d", &qual);
- printf("\n\n");
- if (gen == 'M') {
- if (qual == 1) {
- if (yos >= 10) {
- sal = 15000;
- } else {
- sal = 10000;
- }
- } else {
- if (yos < 10) {
- sal = 10000;
- } else {
- sal = 7000;
- }
- }
- }
- else{
- if (qual == 1) {
- if (yos >= 10) {
- sal = 12000;
- } else {
- sal = 9000;
- }
- } else {
- if (yos < 10) {
- sal = 10000;
- } else {
- sal = 6000;
- }
- }
- }
- printf("Salary is %d\n\n", sal);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement