Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // To execute C++, please define "int main()"
- int main() {
- unsigned long int tax;
- unsigned long int amt = 0;
- cout << "Enter the amount to be taxed:\n";
- cin >> tax;
- if( tax <= 100000 ){
- cout << "No tax to be payed!";
- }
- else{
- tax -= 100000;
- if(tax > 100000){
- amt += 100000*20/100;
- tax -= 100000;
- if(tax >= 300000){
- amt += 300000 * 30 / 100;
- tax -= 300000;
- amt += tax * 50 / 100;
- }
- else {
- amt += tax * 30 / 100;
- }
- }
- else{
- amt += tax * 20 / 100;
- }
- cout << "Tax to be payed: " << amt;
- }
- }
Add Comment
Please, Sign In to add comment