A slack variable approach is developed for solving general discrete-time state constrained optimal control problems. The discrete-time model is obtained from the continuous-time model described by the plant, the performance index, and the state constraints. The solution approach for the discrete-time systems follows the slack variable approach for the solution of the continuous-time systems in which additional states are added according to the order of the state constraint. The Pontryagin Principle gives the necessary conditions for optimality. Because the nature of the discrete formulation and the little overhead in the implementation of iterations in digital computers, the resulting discrete-time system can be solved efficiently using gradient methods such as steepest descent or conjugate gradient. Two examples including one on an F-16 aircraft are provided.