It really depends on where that code is: if it's part of your Main method, then teh simplest solution is just
if(i > 10)
Console.WriteLine("num not ok ");
The return statement exits the current method immediately, and in the case of the Main method, that also ends the program - the integer that you return is passed to the system as a "reason for exit" where zero is "normal exit" and any nonm-zero value is an error code.
If you aren't in the Main function, then you need to use