Sunday 13 November 2016

Program that accept a salary and return tax


Write a function that accepts a salary and returns the tax according to the following rules:   No tax for first Rs.1000 , 5% tax for second Rs.1000 , 4% tax for third Rs.1000,  3% for remained untaxed salary

#include<iostream.h>
#include<conio.h>
int TAX(int sal);
void main()
{
      clrscr();
      int salary , tax;
      cout<<"Enter salary: ";
      cin>>salary;
      tax = TAX(salary);
      if(tax == 0)
          cout<<"No Tax";
      else
         cout<<"The Tax is : "<<tax;
      getch();
}
int TAX(int sal)
{
      int tax;
      if(sal > 3000)
         return (5*1000)/100
}
Share:

Popular Posts

Recent Posts

Unordered List

Text Widget

Pages

About Me

My photo
A group of two, with a little hope of helping beginners to learn how to code :)
Powered by Blogger.

Comments

Facebook

Ad Home

Follow Us

Random Posts

Sponsor

Recent Posts

Header Ads

Popular Posts

Copyright © Functions in C++ | Powered by Blogger

Design by ThemePacific | Blogger Theme by NewBloggerThemes.com | Distributed By Blogger Templates20