The traditional economic order quantity is based on average cost analysis. Often it has been argued that incorporating the time value of money will not have a significant effect on the lot size. However, in 1988, Professor Rachamadugu provided the bounds for the discounted order quantity and showed that the accuracy of the average analysis is dependent, among other factors, on the ratio of noncapital-related holding charges such as material handling and warehousing to the total holding charges. Due to the above reason, with bounds for discounted order quantity, this article presents a simple algorithm to get the optimal economic order quantity. This algorithm can be used to solve some inventory problems.