C Program for calculation of Gross Salary
This program takes into account the allowances of a particular candidate and then finally counts the Gross Salary.
The value of the Basic Salary is entered through the keyboard.
Lara's basic salary is input through the keyboard.
Her dearness allowance is 35% of basic salary, and house rent allowance is
25% of basic salary. Write a program to calculate her gross salary.
#include<stdio.h>
main ()
{
int basic;
float gross;
printf("Enter your Basic Salary: ");
scanf("%d", &basic);
gross = basic+(0.35*basic)+(0.25*basic);
printf("Your Gross Salary is: %f",gross);
}
The value of the Basic Salary is entered through the keyboard.
Lara's basic salary is input through the keyboard.
Her dearness allowance is 35% of basic salary, and house rent allowance is
25% of basic salary. Write a program to calculate her gross salary.
#include<stdio.h>
main ()
{
int basic;
float gross;
printf("Enter your Basic Salary: ");
scanf("%d", &basic);
gross = basic+(0.35*basic)+(0.25*basic);
printf("Your Gross Salary is: %f",gross);
}
Comments
instead of 0.35*basic