C language to compile a program for calculating personal income tax, requires the input of the amount of income, can output the amount of personal income tax payable

Source: Internet
Author: User

C language to compile a program for calculating personal income tax, requires the input of the amount of income, can output the amount of personal income tax payable

Compile a program for calculating personal income tax, which requires the input of the amount of income and the ability to generate the payable

Personal income tax. The individual income tax collection method is as follows:

The starting point is the part where 3500 RMB does not exceed 1500 RMB, and the levy is 3%. The amount exceeds 1500 ~ RMB 4500 million, with a levy of RMB 10% million; more than RMB 4500 million ~ RMB 9000 million, with a levy of RMB 20% million; more than RMB 9000 million ~ RMB 350000 million, with a levy of RMB 25% million; more than RMB 35000 million ~ RMB 55000 million; RMB 30% million; more than RMB 55000 million ~ Part of the RMB 80000, with a levy of 35%.

# Include
 
  
# Define TAXBASE 3500 // start point typedef struct {// tax collection interval and tax collection rate long start; long end; double taxrate;} TAXTABLE; TAXTABLE TaxTable [] ={{ 0.03 }, {1500,4500, 0.10 },{ 4500,9000, 0.20 },{ 9000,35000, 0.25 },{ 35000,55000, 0.30 },{ 55000,80000, 0.35 },{ 80000, 1e9, 0.45 }}; double CaculateTax (long profit) {int I; double tax = 0.0; profit-= TAXBASE; for (I = 0; I
  
   
TaxTable [I]. start) {if (profit> TaxTable [I]. end) {tax + = (TaxTable [I]. end-TaxTable [I]. start) * TaxTable [I]. taxrate;} else {tax + = (profit-TaxTable [I]. start) * TaxTable [I]. taxrate; printf ("Tax scope: % 6ld ~ % 6ld tax amount in this range % 6.2f \ n ", TaxTable [I]. start, TaxTable [I]. end, tax); return tax;} printf ("tax scope: % 6ld ~ % 6ld: % 6.2f \ n ", TaxTable [I]. start, TaxTable [I]. end, tax) ;}}return tax ;}void main () {long profit; double tax; printf ("Enter your personal income amount :"); scanf ("% ld", & profit); tax = CaculateTax (profit); printf ("your personal income tax is: % f \ n", tax );}
  
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.