Q: Ramesh’s basic salary is input through
the keyboard. His dearness allowance is 40% of basic salary, and house rent
allowance is 20% of basic salary. Write a program to calculate his gross
salary.
#include<stdio.h>
#include<conio.h>
void main(void)
{
int bas_sal;
float med_al, h_rent, gross_sal;
clrscr();
printf("Please enter Ramesh basic Salary : ");
scanf("%d", &bas_sal);
med_al = 40*bas_sal/100;
h_rent = 20*bas_sal/100;
gross_sal= bas_sal + med_al + h_rent;
printf("\nRameshs Gross Salary = %f ", gross_sal);
getch();
}
#include<stdio.h>
#include<conio.h>
void main(void)
{
int bas_sal;
float med_al, h_rent, gross_sal;
clrscr();
printf("Please enter Ramesh basic Salary : ");
scanf("%d", &bas_sal);
med_al = 40*bas_sal/100;
h_rent = 20*bas_sal/100;
gross_sal= bas_sal + med_al + h_rent;
printf("\nRameshs Gross Salary = %f ", gross_sal);
getch();
}
No comments:
Post a Comment