Solving equations with iterative and break methods