Stay Tuned!

Subscribe to our newsletter to get our newest articles instantly!

C++ Programming

Inline Function to Display the Net Payment to the Employee

Inline Function

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

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.

You may also like

program to find leap year
C++ Programming

C++ Program to Find Leap Year by Using Function

  • March 3, 2016
Write a program to find if the inputted year is a leap year or not by using the concept of