bsc

Comprehensive codebase and coursework for the 4-year B.Sc. Computer Science Honours degree (WBSU)

git clone https://github.com/notamitgamer/bsc.git
· rebuilt hourlyOpen on GitHub
root / semester_1 / tuition-c / P009.c

P009.c (520B)


      1 /* WAP to calculate gross and net salary
      2 by accepting basic salary as input.
      3 IMP :	DA = 30% of Basic Pay
      4 		HRA = 20% of Basic Pay
      5 		PF = 12.5% of Basic Pay
      6  Gross Salary = Basic Pay + DA + HRA
      7  Net Salary = Gross Salary - PF
      8 */
      9 
     10 #include<stdio.h>
     11 int main() {
     12 	double bs, da, hra, pf, gs, ns;
     13 	printf("Enter the Basic Salary : ");
     14 	scanf("%lf", &bs);
     15 	da = bs * 0.3;
     16 	hra = bs * 0.2;
     17 	pf = bs * 0.125;
     18 	gs = bs + da + hra;
     19 	ns = gs - pf;
     20 	printf("\nGross Salary : %lf"
     21 		   "\nNet Salary   : %lf", gs, ns);
     22 	return 0;
     23 }