write a c program to calculate the income tax of the
employees in an organization where the conditions are given as.
(I.T. = 0 if income <100000
I.T = 10% if income _< 200000
it = 20% if income >_ 200000)
Answer Posted / akshit mahajan
#include <stdio.h>
int main()
{
// declaring variables
float income;
printf("Enter your income
");
scanf("%f", &income);
float tax_for_1_lac_and_above = (income)*0.10; // no addition beause no tax is applicable for less than 1lac so no previous summation
float tax_for_2_lac_and_above = (income - 200000) * 0.20 + 10000; //+10000(10k) because 10% of 100000(1lac)(previous summation)
if (income >= 100000)
{
printf("Your tax is 10%% and the tax will be %0.2f", tax_for_1_lac_and_above);
}
else if (income >= 200000)
{
printf("Your tax is 20%% and the tax will be %0.2f", tax_for_2_lac_and_above);
}
else if (income < 100000)
{
printf("No tax");
}
return 0;
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is c++ used for today?
Explain what is output redirection?
Why do we need a structure?
What is modeling?
What is the use of a semicolon (;) at the end of every program statement?
What is the best way of making my program efficient?
What is volatile c?
What does the && operator do in a program code?
How does #define work?
What is pointer in c?
What is an arrays?
What is the newline escape sequence?
What is a null string in c?
What is logical error?
Why structure is used in c?