In this paper, a cooperative quantum genetic algorithm-particle swarm algorithm (CQGAPSO) is applied to tune both structure and parameters of a feedforward neural network (NN) simultaneously. In CQGAPSO algorithm, QGA is used to optimize the network structure and PSO algorithm is employed to search the parameters space. The amplitude-based coding method and cooperation mechanism improve the learning efficiency, approximation accuracy and generalization of NN. Furthermore, the ill effects of approximation ability caused by redundant structure of NN are eliminated by CQGAPSO. The experimental results show that the proposed method has better prediction accuracy and robustness in forecasting the sunspot numbers problems than other training algorithms in the literatures.