public static void Main(string[] args)
double CustomerAmount = 20;
double ProductPrice = 5.50;
double BlanceAmount = CustomerAmount >= ProductPrice ? (CustomerAmount - ProductPrice) : 0.00;
int[] Denominations = {50, 40, 20, 10, 2, 1};
int LastVal = Denominations.Last();
Console.WriteLine("Your Change is:");
foreach (int item in Denominations)
Value = (int)BlanceAmount / item;
BlanceAmount = BlanceAmount % item;
Console.WriteLine($"{Value} x £{item}");
if (LastVal == item && BlanceAmount != 0)
Console.WriteLine($"1 x {string.Format("{0:f2}", BlanceAmount).Remove(0, 2)}p");
Console.WriteLine("Please provide a valid CustomerAmount...");