Program in C to find out TOTAL SALARY with (IF-ELSE)

Write a program in C to find out TOTAL SALARY with (IF-ELSE)
 
#include <stdio.h>

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 ();
}


Post a Comment