Saturday 10 December 2011

Write a program to input your Basic Salary and find out Allowance, Deduction and Net Salary in c

#include
#include
main()
{
int bs,al,de,ns;
char g;
clrscr();
printf("Enter Your Salary:");
scanf("%d",&bs);
al=(25*bs)/100;
de=(bs+al)/100*10;
ns=(bs+al)-de;
printf("Your Basic Salary is: %d",bs);
printf("\n your Allowance is: %d",al);
printf("\n Your Deduction is: %d",de);
printf("\n Your Net Salary is: %d",ns);
if(ns>=15000)
printf("\n Grade: A");
if(ns<15000&&ns>10000)
printf("\n Grade: B");
if(ns<10000&&ns>5000)
printf("\nGrade: C");
if(ns<5000)
printf("\n Grade: D");
getch();
}



OUTPUT
Enter Your Salary=5000

Your Basic Salary is:5000

Your Allowance is:-60

Your Deduction is:490

Your Net Salary is:4450

Grade :D

No comments:

Post a Comment