blob: 26a9bbbe02c4b385464d33f58333055f4298e031 (
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.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 * 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;
}
|