Previous Next
0 / 13
Module DEMO-32-56DEMO-C-32

Tax Bracket If Statement

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Ahmed Al-Khateeb, a resident of Amman, wants to calculate his tax based on his income. He knows that if he earns less than or equal to JOD 5,000 per year, he has to pay 10% of his income in taxes. However, if he earns more than JOD 5,000 but less than JOD 10,000, he has to pay 15% of his income in taxes. He asks for your help in writing a simple program that will ask him about his income and then print out the tax amount based on the given conditions.

Constraints


Input Format

user input: yearly income int

Output Format

tax amount to be paid int

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
5000
tax=500
Sample #2
Public sample
7500
tax=1125

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings