We develop several iterative methods for computing generalized inverses using both first and second order optimization methods in C*-algebras. Known steepest descent iterative methods are generalized in C*-algebras. We introduce second order methods based on the minimization of the norms parallel to Ax - b parallel to(2) and parallel to x parallel to(2) by means of the known second order unconstrained minimization methods. We give several examples which illustrate our theory.