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 */
double mealCost;
int tipPercent;
int taxPercent;
cin>>mealCost;
cin>>tipPercent;
cin>>taxPercent;
float tip,tax;
double totalCost;
tip=(mealCost*tipPercent)/100;
tax=(mealCost*taxPercent)/100;
totalCost=mealCost+tip+tax;
totalCost=(int)totalCost;
cout<<"The total meal cost is "<<totalCost<<" dollars.";
return 0;
}
please tell me what is wrong in this code ?
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 →
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */
double mealCost; int tipPercent; int taxPercent; cin>>mealCost; cin>>tipPercent; cin>>taxPercent; float tip,tax; double totalCost;
} please tell me what is wrong in this code ?