We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int tipPercent,taxPercent;
float mealCost,tip,tax,totalCost;
tip=(mealCost*tipPercent)/100.0;
tax=(mealCost*taxPercent)/100.0;
totalCost=mealCost+tip+tax;
cin>>mealCost;
cin>>tipPercent;
cin>>taxPercent;
int TotalCost = (int)round(totalCost);
cout<<"The total meal cost is "<
Cookie support is required to access HackerRank
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 →
SIR what is wrong in this code
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */
int tipPercent,taxPercent; float mealCost,tip,tax,totalCost; tip=(mealCost*tipPercent)/100.0; tax=(mealCost*taxPercent)/100.0; totalCost=mealCost+tip+tax; cin>>mealCost; cin>>tipPercent; cin>>taxPercent; int TotalCost = (int)round(totalCost); cout<<"The total meal cost is "<