Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
150108_RecursividadFibonacci
Thread and Mutex Code
Max2
C_141126_ArrayMayorMenor02
fork() System call
Sunday assignment late v3
Array Struct, Call-By-Reference, Malloc, Free, Init, Destroy ... Example
141124_PI
b=1,c=1
4 mejorado trabajo semanal 4
Please log in to post a comment.