Sets of Ultrasonic frequencies using arduino uno
There are three parts to this project, one of which you asked:


I need to generate a frequency greater than 40 khz using arduino uno?


This one is easy: Yes. You can use the tone() library call. You can specify a frequency up to 8mhz. You can call this in the void setup{} part of your code, and (if you don't want to do anything else), leave the void loop() {} empty. You might want to generate an audible tone for a short period first, to show that it is working.


You need something to actually make the sound. 


Depending on the frequency, most speakers won't do the trick, or will do it at a very low volume. Speakers are made to work with audible frequencies. Even then, some speakers (larger ones) are better at low frequencies; others (smaller ones) are better at higher audible frequencies. I think piezoelectric buzzers would give you a better response at higher frequencies. In any case, whatever you buy find out the frequency response for the specific part, find the frequency you intend to use along the bottom, then see what the volume (db) is for that frequency - this will give you an indication of how loud it will be. Remember that you won't be able to hear it.

The circuit is pretty trivial. Google piezo arduino


Efficacy: 


From https://en.wikipedia.org/wiki/Electronic_pest_control#Effects_on_rodents


  Rodents adjust to the ultrasound (or any new sound) and eventually ignore it. At best, ultrasonic waves have only a partial or temporary effect on rodents. Numerous studies have rejected ultrasonic sound as a practical means of rodent control.Tests of commercial ultrasonic devices have indicated that rodents may be repelled from the immediate area of the ultrasound device for a few minutes to a few days, but they will nearly always return and resume normal activities. Other tests have shown that the degree of repellance depends on the frequency, intensity, and pre-existing condition of the rodent infestation. The intensity of such sounds must be so great that damage to humans or domestic animals would also be likely; commercial ultrasonic pest control devices do not produce sounds of such intensity.