C-programming - Program to find total salary, To find total salary with If Else

Program to find total salary

This program calculates the total salary of a person with IF-ElSE


#include<stdio.h>

#include<conio.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 ();

}



output:

Enter salary 2500

Total salary 2825

The topic on C-programming - Program to find total salary is posted by - Maha

Hope you have enjoyed, C-programming - Program to find total salaryThanks for your time

Tech Bluff