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.
*why my code is giving error plz tell it is matching with the required output
main() { double mc; float tip,tax; int ttip,tp,totalcost; scanf("%lf%d%d",&mc,&ttip,&tp); tip = (mc((ttip)/100.0)); tax = (mc*((tp)/100.0)); totalcost =mc+tip+tax; printf("The total meal cost is %d dollars",totalcost); /* Enter your code here. Read input from STDIN. Print output to STDOUT /
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 →
*why my code is giving error plz tell it is matching with the required output main() { double mc; float tip,tax; int ttip,tp,totalcost; scanf("%lf%d%d",&mc,&ttip,&tp); tip = (mc((ttip)/100.0)); tax = (mc*((tp)/100.0)); totalcost =mc+tip+tax; printf("The total meal cost is %d dollars",totalcost); /* Enter your code here. Read input from STDIN. Print output to STDOUT / return 0; *