-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaxcal.c
338 lines (253 loc) · 15.4 KB
/
taxcal.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
//This is a C program to check your eligibility to pay tax , calculate your personal income tax and save maximum tax legally
//Disclaimer :-
//We are not a qualified professionals and we don't have a CA or relevant degree below program is completely made
//by consulting information available at Income Tax department of India although our program is very reliable but proceed
//with your own risk
//This program was made in compliance of rules present up-to date 29 June 2021
//References :
//Income Tax Department of India https://incometaxindia.gov.in/Pages/default.aspx
//ET Money https://www.etmoney.com/tools-and-calculators/income-tax-calculator
//Income Tax Act of India https://www.incometaxindia.gov.in/pages/acts/index.aspx
#include<stdio.h>
#include<string.h>
long int annual_salary=0; //Variable to save individual annual salary
long int net_salary=0; //Net salary is amount you get after reducing exemptions from your annual salary
long int net_annual_income=0; //net annual income is the amount on which you will pay tax . It is also net taxable income after some deductions
long int total_exemption=0; //This the amount of total exemptions you get in a year
long int total_tax=0; //This is the amount of tax you will pay in the financial year
int choice=0;
char eligibile[3];
void eligibility(); //Function to determine your eligibility to pay tax
void t_exemption(); //Function to calculate total exemption you get on on your annual salary and net annual salary
void n_annual_income(); //Function to calculate net annual income i.e. net annual salary + other source of income
void t_tax(); //Function to calculate total tax of the financial year
int main()
{
char user_name[10];
printf("\n****************************************************\n\n");
printf("\n\nPlease enter your name : \n");
scanf("%s",&user_name);
printf("\n ................................................................................................\n");
printf(" .. ..\n");
printf(" .. ..");
printf("\n .. Welcome to our program '%s' , hope you are doing well ..\n",user_name);
printf(" .. ..\n");
printf(" .. This program will determine your eligibility , total tax and max out your tax savings ..\n");
printf(" .. ..\n");
printf(" ................................................................................................\n");
eligibility();
if(choice == 0)
{
t_exemption();
n_annual_income();
t_tax();
if(net_annual_income < 500000)
{
printf("\n\nAs your net taxable income is less than 5 Lahk you can avail a rebate of Rs. 12500!\n");
printf("\n..............................................................................................\n");
}
else
{
printf("\n\nAs your net taxable income is greater than 5 Lakh you cannot avail the rebate!\n");
}
}
printf("\nThank you using our program!\n\n");
printf("\n****************************************************\n\n");
printf("\n\n\n----------> HOW TO SAVE MORE TAX LEGALLY ? <----------");
printf("\n\n# A] Tax deduction under section 80 of IT act : \n");
printf("\n a] Deduction of upto 1.5 Lakh under section 80C by investing in following schemes : \n");
printf(" 1. Public Provident Fund (PPF) \n");
printf(" 2. Equity Saving Schemes (ELSS) \n");
printf(" 3. Sukanya Samriddhi Yojana (SSY) \n");
printf(" 4. Premium paid for term insurance \n");
printf(" 5. Payment towards principal home loan \n");
printf("\n b] Deduction of upto Rs.50k under section 80CCD by investing in NPS \n");
printf("\n c] Deduction of upto Rs.10k under section 80TTA by the interest earned from saving accounts \n");
printf("\n\n#B] You also can get deduction on interest paid on Education loan \n");
printf("\n\n#C] Deduction of upto Rs.2Lakh under section 24 by the interest paid on home loan in the financial year.\n\n");
printf("\n------------------> END OF PROGRAM <------------------");
printf("\n\n\n****************************************************\n");
printf("****************************************************\n\n");
}
void eligibility()
{
int ch1=0;
do
{
printf("\n\n\n##### ---> If your are eligible for any of the following conditions enter 'YES' if not then enter 'NO' : <--- ####\n\n");
printf("-------> 1)Your gross annual income is less than 2.5 lakh\n");
printf("-------> 2)Your annual total income comes directly or indirectly only from agriculture\n");
printf("-------> 3)Non resident foreign national\n");
printf("-------> 4)Disability pension of all armed forces\n");
printf("-------> 5)Any income received from working in Indian Institution like embassy, legation etc.\n");
printf("\nEnter your input ( if eligible for any condition enter 'YES' or else 'NO' ) \n");
//scanf("%d",&choice);
scanf("%s",&eligibile);
if(strcmp(eligibile , "YES")==0)
{
printf("\n---->Congratulations you don't have to pay taxes!<----\n");
ch1 = 1;
choice = 1;
printf("\n..............................................................................................\n");
return;
}
else if(strcmp(eligibile , "NO")==0)
{
printf("\n####--->You are eligible to pay tax!<---####\n");
ch1 = 1;
printf("\n..............................................................................................\n");
return;
}
else
{
printf("\nInvalid input!\n");
printf("Enter either 'NO' if not eligible for any condition or 'YES' if eligible for even single condition\n");
}
} while (ch1==0);
}
void t_exemption()
{
int ch2 = 2;
long int hra,lta;
char rent[3];
printf("\nEnter your annual salary : \n");
scanf("%d",&annual_salary);
printf("\nYour annual salary is : %d",annual_salary);
do
{
printf("\n\nDo you live in a rented house or not : \n");
printf("Enter 'YES' if Yes and 'NO' if not\n");
//scanf("%d",&ch2);
scanf("%s",&rent);
if(strcmp(rent , "YES")==0)
{
ch2 = 0;
printf("\nEnter your actual HRA received this year : \n");
scanf("%d",&hra);
printf("\nEnter your annual LTA \n");
scanf("%d",<a);
printf("\nYour total exemption is HRA + LTA + Standard Deduction(Rs.50 k) \n");
total_exemption = hra + lta + 50000;
printf("\n####----> Total exemption = %d <----####\n",total_exemption);
printf("\nYour net salary is = Annual salary - Exemption - Standard Deduction \n");
net_salary = annual_salary - total_exemption ;
printf("\n####---->Your net salary is %d<----####\n",net_salary);
printf("\n..............................................................................................\n");
}
else if(strcmp(rent , "NO")==0)
{
ch2 = 0;
printf("\nYour total exemption = Standard Deduction(Rs.50 k) \n");
total_exemption = 50000;
printf("\n###---> Total exemption = %d <---###\n",total_exemption);
printf("\nYour net salary is = Annual salary - Standard Deduction \n");
net_salary = annual_salary - total_exemption ;
printf("\n###--->Your net salary is %d<---###\n",net_salary);
printf("\n..............................................................................................\n");
}
else
{
printf("\nInvalid Input!");
}
}while(ch2 > 1);
}
void n_annual_income()
{
long int other_source=0;
printf("\n\n---->Now we will calculate your net annual income\n");
printf("\nInput the amount of sum of all other sources you obtained this financial year\n");
printf("This includes sources like Rent , Capital gains , etc.\n");
printf("\nInput your amount : ");
scanf("%d",&other_source);
printf("\nYour income from other sources is %d in this financial year!",other_source);
printf("\n\nNet annual Income = Net annual Salary + Other sources of income");
net_annual_income = net_salary + other_source;
printf("\n\n---->Your net annual income is %d !<----\n",net_annual_income);
printf("\n..............................................................................................\n");
}
void t_tax()
{
long int temp_tax;
printf("\nNow we have arrived at most crucial step of calculating your total tax of this financial year using new tax slab!\n\n");
if(net_annual_income <= 250000)
{
printf("\nDue to tax exemptions and reductions you are not eligible to pay tax!\n");
printf("\n..............................................................................................\n");
}
else if(net_annual_income > 250000 && net_annual_income <= 500000)
{
printf("\nAccording to the new tax slab rates you will be charged 5 percent of the income from Rs. 2.5 Lakh to Rs. 5 Lakh \n");
temp_tax = net_annual_income - 250000;
total_tax = ((temp_tax*5)/100);
printf("\n ...............................................................................");
printf("\n . .");
printf("\n . ###----->>> You will pay Rs %d tax this financial year! <<<-----### .",total_tax);
printf("\n . .");
printf("\n ...............................................................................");
printf("\n\n\n\n..............................................................................................\n");
}
else if(net_annual_income > 500000 && net_annual_income <= 750000)
{
printf("\nAccording to the new tax slab rates you will be charged Rs.12500 and 10 percent of the amount you earned between RS.5 Lakh to Rs.7.5 Lakh\n");
temp_tax = net_annual_income - 500000;
total_tax = ((temp_tax*10)/100) + 12500;
printf("\n ...............................................................................");
printf("\n . .");
printf("\n . ###----->>> You will pay Rs %d tax this financial year! <<<-----### .",total_tax);
printf("\n . .");
printf("\n ...............................................................................");
printf("\n\n\n\n..............................................................................................\n");
}
else if(net_annual_income > 750000 && net_annual_income <= 1000000)
{
printf("\nAccording to the new tax slab rates you will be charged Rs.37500 and 15 percent of the amount you earned between RS.7.5 Lakh to Rs.10 Lakh\n");
temp_tax = net_annual_income - 750000;
total_tax = ((temp_tax*15)/100) + 37500;
printf("\n ...............................................................................");
printf("\n . .");
printf("\n . ###----->>> You will pay Rs %d tax this financial year! <<<-----### .",total_tax);
printf("\n . .");
printf("\n ...............................................................................");
printf("\n\n\n\n..............................................................................................\n");
}
else if(net_annual_income > 1000000 && net_annual_income <= 1250000)
{
printf("\nAccording to the new tax slab rates you will be charged Rs.75000 and 20 percent of the amount you earned between RS.10 Lakh to Rs.12.5 Lakh\n");
temp_tax = net_annual_income - 1000000;
total_tax = ((temp_tax*20)/100) + 75000;
printf("\n ...............................................................................");
printf("\n . .");
printf("\n . ###----->>> You will pay Rs %d tax this financial year! <<<-----### .",total_tax);
printf("\n . .");
printf("\n ...............................................................................");
printf("\n\n\n\n..............................................................................................\n");
}
else if(net_annual_income > 1250000 && net_annual_income <= 1500000)
{
printf("\nAccording to the new tax slab rates you will be charged Rs.125000 and 25 percent of the amount you earned between RS.12.5 Lakh to Rs.15 Lakh\n");
temp_tax = net_annual_income - 1250000;
total_tax = ((temp_tax*25)/100) + 125000;
printf("\n ...............................................................................");
printf("\n . .");
printf("\n . ###----->>> You will pay Rs %d tax this financial year! <<<-----### .",total_tax);
printf("\n . .");
printf("\n ...............................................................................");
printf("\n\n\n\n..............................................................................................\n");
}
else if(net_annual_income > 1500000)
{
printf("\nAccording to the new tax slab rates you will be charged Rs.187500 and 30 percent of the amount you earned after 15 Lakh\n");
temp_tax = net_annual_income - 1500000;
total_tax = ((temp_tax*30)/100) + 187500;
printf("\n ...............................................................................");
printf("\n . .");
printf("\n . ###----->>> You will pay Rs %d tax this financial year! <<<-----### .",total_tax);
printf("\n . .");
printf("\n ...............................................................................");
printf("\n\n\n\n..............................................................................................\n");
}
else
{
printf("\n\nInvalid Inputs!");
}
}