WAP to calculate tax given the following condition: If income is less than 150,000, then no tax If income in the range of 150,001-300,000, then charge 10% tax If income is in the range of 300,001-500,000, then charge tax of 20% If income is above 500,001, then charge tax of 30%
#include <stdio.h>
void main(){
float amount;
float tax=0;
printf("Enter the amount of income: ");
scanf("%f",&amount);
if(amount<=150000){
tax=0;
}else if(amount>150000 && amount<=300000){
tax=amount*0.1;
}else if(amount>300000 && amount<=500000){
tax=amount*0.2;
}else{
tax=amount*0.3;
}
if(tax==0){
printf("\nNo tax.\n");
}else{
printf("\nThe tax = $%.2f\n",tax);
}
getchar();
}