Friday, 19 September 2014

Assume that USA uses the following income tax code formula for their annual income:- First US$ 5000 of income tax is 0% tax, next US$ 10,000 of income 10% tax, next US$ 20,000 of income 15% tax, and an amount above US$ 35,000 20% tax.


#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
char ch;
long int k,b,a;
do
{
printf("\nEnter the income to be calculate tax");
scanf("%ld",&a);
k=0;
if(a>5000)
{
k=k+0;
}
if(a>10000)
{
k=k+1000;
}
if(a>20000)
{
k=k+3000;
}
if(a > 35000)
{
b=a-35000;
b=b*20/100;
k+=b;
}
printf("\n The calculate tax is = %ld ",k);
printf("\n Do you want to continue(y/n)...");
ch=getche();
}while(ch=='y' || ch=='Y');
getch();
}

No comments:

Post a Comment

Please write your doubts