A modified implicit approximate-factorization algorithm, called SIAF algorithm, has been applied to solve the Euler and Navier-Stokes equations for two-dimensional and axisymmetric internal flows. By uncoupling the system of equations using the similarity transformation, a considerable computation time is saved. The results for various flows, such as planar and axisymmetric ramjet nozzle and JPL nozzle, are quite satisfactory. The solutions of Euler and Navier-Stokes equations are similar in many cases, however, the two differ substantially for flows in the JPL nozzle.