[ create a new paste ] login | about

Link: http://codepad.org/ASyItrGE    [ raw code | output | fork ]

C, pasted on Apr 5:
#include<stdio.h>

int main(void){

float inm;

printf("Enter the amount of taxable  income:");
//scanf("%f",&inm);

inm = 3000;

if(inm<750){
printf("tax due :%f",inm*1/100);
}
if(inm>=750 && inm<=2250){
printf("tax due :%f",inm=7.50+((inm-750)*2/100));
}

if(inm>=2251 && inm<=3750){
printf("tax due :%f",inm=37.50+((inm-2250)*3/100));//problem at this line (inm-2250) not getting multiplied by *3/100   
}
return 0;
}


Output:
1
Enter the amount of taxable  income:tax due :60.000000


Create a new paste based on this one


Comments: