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 are header files in c?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
Explain what is dynamic data structure?
largest Of three Number using without if condition?
Where are local variables stored in c?
List a few unconditional control statement in c.
What does the c in ctime mean?
Why void is used in c?
How do you view the path?
What is pointer & why it is used?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
How is null defined in c?
Explain what is the use of a semicolon (;) at the end of every program statement?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
What are the three constants used in c?