Program Console Vignaankosh.com
Execution Panel
Console is empty.
Income Tax Calculator (Old Regime) is an interactive C dry run visualizer from the If programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.
This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.
#include <stdio.h>
int main() {
float annual_income, tax = 0;
printf("Enter your annual income (in rupees): ");
scanf("%f", &annual_income);
if (annual_income <= 250000) {
tax = 0;
printf("\nNo Tax Liability\n");
printf("Income up to ₹2,50,000 is tax-free\n");
}
else if (annual_income <= 500000) {
tax = (annual_income - 250000) * 0.05;
printf("\nTax Slab: 5%% on amount above ₹2,50,000\n");
printf("Rebate under Section 87A may apply\n");
}
else if (annual_income <= 1000000) {
tax = 12500 + (annual_income - 500000) * 0.20;
printf("\nTax Slab: ₹12,500 + 20%% on amount above ₹5,00,000\n");
}
else {
tax = 112500 + (annual_income - 1000000) * 0.30;
printf("\nTax Slab: ₹1,12,500 + 30%% on amount above ₹10,00,000\n");
}
if (annual_income <= 500000 && tax > 0) {
tax = 0;
printf("\n Rebate under Section 87A applied\n");
printf("Tax liability reduced to NIL\n");
}
float cess = tax * 0.04;
float total_tax = tax + cess;
printf("\n========================================\n");
printf(" INCOME TAX CALCULATION\n");
printf("========================================\n");
printf("Annual Income : ₹%.2f\n", annual_income);
printf("Income Tax (before cess): ₹%.2f\n", tax);
printf("Health & Education Cess: ₹%.2f (4%%)\n", cess);
printf("----------------------------------------\n");
printf("TOTAL TAX PAYABLE : ₹%.2f\n", total_tax);
if (total_tax == 0) {
printf("\n No tax payable. Great savings!\n");
} else {
printf("\nEffective Tax Rate : %.2f%%\n", (total_tax / annual_income) * 100);
}
printf("========================================\n");
return 0;
}