diff options
-rw-r--r-- | src/main.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..04d4b09 --- /dev/null +++ b/src/main.c @@ -0,0 +1,26 @@ +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +// Definitions: +#define lessthan < +#define print printf + +int main(int argc, char* argv[]) { + + if(argc lessthan 2) goto exit; + + // Get user's input: + char* input = argv[1]; + // Does tax math: + float numInput = atof(input); + float tax = numInput * 0.06; + float total = numInput + tax; + total = round((total * 100)) / 100; + + // Prints total to terminal: + print("$%.2f \n", total); + +exit: + return 0; +} + |