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.
wrong and spam answers will be reported
Answers
Answer:
Gday, mate✌…….
Explanation:
#include<stdio.h>
int main()
{
float basic_salary, dallowance, house_rent, gross_salary;
printf("Enter Basic Salary: ");
scanf("%f",&basic_salary);
dallowance = 0.4 * basic_salary;
house_rent = 0.2 * basic_salary;
gross_salary = basic_salary + dallowance + house_rent;
printf("\n Basic Salary: %.2f", basic_salary);
printf("\n Dearness Allowance: %.2f", dallowance);
printf("\n House Rent: %.2f", house_rent);
printf("\n\n Gross Salary: %.2f", gross_salary);
getch();
return (0);
Explanation:
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ( )
{
float basic salary,allowance,house rent,gross salary;
clrscr( );
printf("enter basic salary, allowance, house rent, gross salary");
scanf("%f%f%f%f",&basic salary, &allowance, &houserent, &gross salary);
allowance =0.4*basic salary;
houserent=0.2*basic salary;
basic salary+allowance+house rent=gross salary;
printf("result is =%f",basic salary);
printf("result is=%f",allowance);
printf("result is=%f",house rent);
printf("result is=%f",gross salary);
getch( );
}