You are viewing a single comment's thread. Return to all comments →
void solve(double meal_cost, int tip_percent, int tax_percent) { double tip, tax; int total_cost; scanf("%lf", &meal_cost); scanf("%d", &tip_percent); tip = (tip_percent*meal_cost)/100; scanf("%d", &tax_percent); tax = (tax_percent*meal_cost)/100; total_cost = round(meal_cost+tip+tax); printf("%d", total_cost); }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Operators
You are viewing a single comment's thread. Return to all comments →
void solve(double meal_cost, int tip_percent, int tax_percent) { double tip, tax; int total_cost; scanf("%lf", &meal_cost); scanf("%d", &tip_percent); tip = (tip_percent*meal_cost)/100; scanf("%d", &tax_percent); tax = (tax_percent*meal_cost)/100; total_cost = round(meal_cost+tip+tax); printf("%d", total_cost); }