C++ Programming

Inline Function to Display the Net Payment to the Employee

Assume that employee will have to pay 10% income tax to the government, ask user to enter the employee salary. Use inline function to display the net payment to the employee by company.

Algorithm

  1. Start
  2. Declare inline function net_payment (sal) to reurn sal=10% of sal.
  3. Enter main ()
  4. Input sal
  5. Total=net(payment(sal))
  6. Stop

Source Code

#include<conio.h>
#include<iostream.h>
inline float net_payment(float sal)
{
               return(sal-(0.1*sal));
}
void main()
{
float sal,total;
clrscr();
cout<<"Enter salary: ";
cin>>sal;
total=net_payment(sal);
cout<<endl<<"Net payment:"<<total;
getch()   ;
}
Back to top button