C language programming) How much will I get after calculate salary, bonus, and tax?
Hi guys~!
I`m lulu~ :-)
Today, I`m going to make program that informs me "How much will I get after calculate salary, bonus, and tax?"
Let`s see how to do this.
#include <stdio.h>
int main() {
int salary, bonus, total; /* they are the variables for storage my salary, bonus, and total. Total, in here, is the sum of salary and bonus. However, you don't have to memorize because we will define down there. */
double tax, real_income; /*we also proclaim tax, and real_income. I proclaimed using "double" because tax and real_income are real numbers*/
salary = 300; //Let's say my salary is $300
bonus = 30; //Let's say my bonus is $30
total = salary + bonus; // Here, I defined total is the sum of salary and bonus.
tax = total * 0.0033; // Also, I defined tax is 3.3% of total
real_income = total - tax; // Then, my real_income will be like this.
printf("Your real_income will be $%.0lf.\n", real_income);
return 0;
}
You can make your program just change the numbers of salary, bonus, and tax.
If you have questions and opinions, e-mail or tell me.
You`ll be welcomed :-)
http://blog.naver.com/96lulu (This is my blog. You can visit for more my daily life, programming .. unfortunately, they are written in korean, but you can see source code, and many pictures of my daily life :-) )
Of course I`ll try harder here.
Thank you
See you again~~
Comments
Post a Comment