You are viewing a single comment's thread. Return to all comments →
try to use Math.Round while Writing the value.
please refer the below code
double tip=0,tax=0,totalCost; double mealCost = Convert.ToDouble(Console.ReadLine()); int tipPercent = Convert.ToInt32(Console.ReadLine()); int taxPercent = Convert.ToInt32(Console.ReadLine());
tip = mealCost * tipPercent / 100; tax = mealCost * taxPercent / 100; totalCost = mealCost + tip + tax; Console.WriteLine("Total Cost of meal is :" + Math.Round(totalCost)); Console.ReadKey();
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 →
try to use Math.Round while Writing the value.
please refer the below code
double tip=0,tax=0,totalCost; double mealCost = Convert.ToDouble(Console.ReadLine()); int tipPercent = Convert.ToInt32(Console.ReadLine()); int taxPercent = Convert.ToInt32(Console.ReadLine());