blob: 2a2317d78e42b006b95c46e69a81b0a1698c94e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "config.c"
// 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 * percent;
float total = numInput + tax;
total = round((total * 100)) / 100;
// Prints total to terminal:
print("$%.2f \n", total);
exit:
//print("No input given,\nplease input the price of your product.\n");
return 0;
}
|