It is well known that a judicious choice of crossover and or mutation rates is critical to the success of genetic algorithms. Most earlier researches focused on finding optimal crossover or mutation rates, which vary for different problems, and even for different stages of the genetic process in a problem. In this paper, a generic scheme for adapting the crossover and mutation probabilities is proposed. The crossover and mutation rates are adapted in response to the evaluation results of the respective offspring in the next generation. Experimental results show that the proposed scheme significantly improves the performance of genetic algorithms and outperforms previous work.