diff --git a/operators.c b/operators.c new file mode 100644 index 0000000..b30a823 --- /dev/null +++ b/operators.c @@ -0,0 +1,20 @@ +#include +#include + +int main() { + double mealCost; + int tipPercent; + int taxPercent; + + scanf("%lf", &mealCost); + scanf("%d", &tipPercent); + scanf("%d", &taxPercent); + + double tip = mealCost * tipPercent / 100; + double tax = mealCost * taxPercent / 100; + int totalCost = (int) round(mealCost + tip + tax); + + printf("%d", totalCost); + + return 0; +}