summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkiz <skiznet@aol.com>2024-09-15 17:05:44 -0400
committerSkiz <skiznet@aol.com>2024-09-15 17:05:44 -0400
commitef2e056301767585b13804fadd2bbfa420743284 (patch)
treef6a8ebb3d34341893b428f1f68421d8c9d3b2879
parent6a346c5a3354d011bb0a455c0f323e4e0e48c90f (diff)
Copied main source over.
-rw-r--r--src/main.c26
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;
+}
+