c语言计算个人所得税
时间: 2023-08-24 12:09:06 浏览: 510
根据提供的引用内容,可以使用C语言编写一个计算个人所得税的程序。根据不同的工资水平,采用不同的税率计算个人所得税。以下是一个示例程序:
```c
#include <stdio.h>
void calculateTax() {
float income, tax = 0;
printf("请输入个人收入:");
scanf("%f", &income);
if (income <= 1600) {
tax = 0;
} else if (income <= 2500) {
tax = (income - 1600) * 0.05;
} else if (income <= 3500) {
tax = (income - 1600) * 0.10;
} else if (income <= 4500) {
tax = (income - 1600) * 0.15;
} else {
tax = (income - 1600) * 0.20;
}
printf("个人所得税为: %.2f\n", tax);
}
int main() {
calculateTax();
return 0;
}
```
这个程序会要求用户输入个人收入,然后根据不同的收入水平计算个人所得税。根据给定的税率,计算个人所得税并输出结果。
#### 引用[.reference_title]
- *1* [C语言:计算个人所得税](https://blog.csdn.net/m0_46973223/article/details/121723378)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [C语言 计算个人所得税](https://blog.csdn.net/AMCUL/article/details/108146133)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文