I am revisiting one of my old exercises and I seem to be having problems with my logic. It is a simple console application that is supposed to calculate and display change for a given total and cash tendered. For some reason, I get an infinite loop when I input values which decimal part other than 25.

Here is a screenshot of my console application
![enter image description here](https://i.stack.imgur.com/b6507.png)

Here is my code

```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace James_Archbold_A2
{
    class Program
    {
        static void Main(string[] args)
        {
            double change,total,cash;
            int  fifties = 0, twenties = 0, tens = 0, fives = 0, ones = 0,
                quarters = 0, dimes = 0, nickels = 0, pennies = 0;

            Console.Write("Please enter the total: ");
            total = Convert.ToDouble(Console.ReadLine());

            Console.Write("Please enter the cash tendered: ");
            cash = Convert.ToDouble((Console.ReadLine()));

            change = CalculateChange(total, cash);
            Console.WriteLine(change);

            change *= 100;

            while (change > 0)
            {

                if (change >= 5000)
                {
                    change -= 5000;
                    fifties++;
                    Console.WriteLine(change);

                }

                else if (change >= 2000)
                {
                    change -=2000;
                    twenties++;
                    Console.WriteLine(change);

                }

                else if (change >= 1000)
                {
                    change -=1000;
                    tens++;
                    Console.WriteLine(change);

                }

                else if (change >= 500)
                {
                    change -= 500;
                    fives++;
                    Console.WriteLine(change);
                }

                else if (change >= 100)
                {
                    change -=100;
                    ones++;
                    Console.WriteLine(change);

                }

                else if (change >= 25)
                {
                    change -=25;
                    quarters++;
                    Console.WriteLine(change);

                }

                else if (change >= 10)
                { 
                    change -=10;
                    dimes++;
                    Console.WriteLine(change);
                }

                else if (change >= 5)
                {
                    change -=5;
                    nickels++;
                    Console.WriteLine(change);

                }

                else if (change >= 1)
                {
                    change -=1;
                    pennies++;
                    Console.WriteLine(change);
                }
            }

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("Total: {0:c}\nCash Tendered: {1:c}" +
                            "\nChange Due: \nFifties: {2}\nTwenties: {3}\nTens: {4}" +
                              "\nFives: {5}\nOnes: {6}\nQuarters: {7}\nDimes: {8}" +
                              "\nNickels: {9}\nPennies: {10}",
                              total, cash, fifties, twenties, tens, fives, ones, quarters, dimes,nickels, pennies);
            Console.WriteLine(sb);
            Console.ReadLine();
        }

        static double CalculateChange(double total, double cash)
        {
            return cash - total;
        }
    }
}

```