Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/ #include <stdio.h> int main() { double a,b; scanf("%lf", &a); if(a>=0 && a<=2000) printf("Isento\n"); else if(a>=2000.01 && a<=3000) { a-=2000; b= a*.08; printf("R$ %.2lf\n",b); } else if(a>=3000.01 && a<=4500) { a-=3000; b= a*.18+80; printf("R$ %.2lf\n",b); } else { a-=4500; b= a*.28+350; printf("R$ %.2lf\n",b); } return 0; }
helpful thank you brother
ReplyDeletebhaiya ei code ta te shomoshha ki bujtesi na!! output is same but URI is not accepting-
ReplyDeletedouble a,b;
scanf("%lf",&a);
if(a>=2000.01 && a<=3000.0){
b=((a-2000)*.08);
printf("%.2lf\n",b);
}
else if(a>=3000.01 && a<=4500.0){
b=((a-3000)*0.18);
printf("R$ %.2lf\n",80+b);
}
else if(a>4500.0){
b=((a-4500)*.28);
printf("R$ %.2lf\n",b+350);
}
else if(a>=0 && a<=2000){
printf("Insento\n");
}
you wrote "Insento" in the last printf,the correct is "Isento"
ReplyDeleteHow you get 80, 350 in 2nd & 3rd else if condition?
ReplyDelete80 comes from 1000*0.08 and 350 is 80 plus 270 which comes from 1500*0.18
ReplyDeleteif the number is greater than 4500 then for sure it has the 8% tax on 1000 which is the difference between the two limits as 3000-2000.The same applies for the 270 as 4500-3000 is 1500 and the tax applied is 0.18.
Hope that was helpful
When I was searching something about tax, I found your blog, after reading your blog about Accounting; I have gained a lot of information. Also I would like to introduce my company, Singapore Tax Accounting which is also providing complete tax solution and Business Advisory in Singapore
ReplyDeletesolution er logic ta bujlam na ,,,,
ReplyDeleteCode ta oshadharon kintu..
ReplyDelete"a-=3000;"
Ei line ta keno bujhlam na...???
that means , a = a -3000
Delete