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(){
int taxp,tipp,total;
double mc,tax,tip;
scanf("%lf %d %d",&mc,&taxp,&tipp);
tax=(taxp/100.0)*mc;
tip=(tipp/100.0)*mc;
//printf("%lf\n%lf\n",tax,tip);
printf("The total meal cost is %d dollars.",(int)(mc+tax+tip));
return (0);}
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 →
include
int main(){ int taxp,tipp,total; double mc,tax,tip; scanf("%lf %d %d",&mc,&taxp,&tipp); tax=(taxp/100.0)*mc; tip=(tipp/100.0)*mc; //printf("%lf\n%lf\n",tax,tip); printf("The total meal cost is %d dollars.",(int)(mc+tax+tip));