program to write salary calculation

TOTAL SALARY

WAP to find out TOTAL SALARY with (IF-ELSE)
void main ()
{
long int sal,hra,ta,ts;
clrscr ();
printf ("Enter Salary: ");
scanf("%ld",&sal);
if (sal>=5000)
{
hra=sal*.10;
ta=sal*.07;
}
else
{
hra=sal*.08;
ta=sal*.05;
}
ts=sal+hra+ta;
printf ("\n\nTotal Salary is Rs.%ld", ts);
getch ();
}

No comments:

Post a Comment