Well, many different ways. If num 1 is a random number between 1 and 40, you can make num2 a random number between 41 and some other high number.
Or if they're both something like a random number between 1-100. You can just make an if statement checking if num2 is higher, if it's not you can generate another random value until it is higher than num1.