Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Incometax problem v1.1
//gcc 5.4.0 #include <stdio.h> //We would like to write a C program to calculate the income tax of the employees in an organization according the following criteria: //- The income tax is zero = 0 if income less than or equal 10,000 //- The income tax is 10% if the income is less than 50,000. Otherwise, the income tax is 20% if the income is greater than 50000 and less than 99,9999 //- For an income greater than or equal 100000, the tax is 30%. //START PROGRAM //double income //double incometax //PRINT "Please Input:\n Name: \n Income:\n" //READ income // if (income<=10000){ // incometax=0; // PRINT "Your income tax is %lf",incometax); // } // else if (income>=10000&&income<=50000){ // incometax=income*.1; // PRINT "Your income tax is $%lf",incometax); // } // else if (income>=50000&&income<=999999){ // incometax=income*.2; // PRINT "Your income tax is $%lf",incometax); // } // else{ // incometax=income*.3; // PRINT "Your income tax is $%lf",incometax); // } //END PROGRAM int main(void) { double income; double incometax; char employeename[30]; int c1=10000; int c2=50000; int c3=999999; printf("Please Input:\n Name: \n Income:\n"); scanf("%s%lf",&employeename,&income); printf("---------------------------------------------\nName:%s\n",employeename); if (income<=c1){ incometax=0; printf("Your income tax is %lf",incometax); } else if (income>=10000&&income<=c2){ incometax=income*.1; printf("Your income tax is $%lf",incometax); } else if (income>=c2&&income<=c3){ incometax=income*.2; printf("Your income tax is $%lf",incometax); } else{ incometax=income*.3; printf("Your income tax is $%lf",incometax); } }
run
|
edit
|
history
|
help
0
tyiy
Practice Problem 7
project menu
Spring 2017 Project 2 v1.2
18BCE2182 ASSESS_1 Q1-5
data types and printf
A_141212_IntercambiarValores
addition
conditional expression
18BCE2182 ASSESS_1 Q1-8