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
How do you convert strings to numbers in C?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Explain what are its uses in c programming?
What are the back slash character constants or escape sequence charactersavailable in c?
What are local variables c?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
How is a null pointer different from a dangling pointer?
i want to know the procedure of qualcomm for getting a job through offcampus
Write the Program to reverse a string using pointers.
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What are the different properties of variable number of arguments?
How can I change their mode to binary?
What is c method?
How can you determine the size of an allocated portion of memory?
which type of aspect you want from the student.