How to inform a c++ program not to pick a specific number within an established series of numbers?

In c++, if I want a program to choose a random number from a specific range of ordered numbers, for example: 1 to 9. How to I inform it to do so, however, not pick a specific number from within that range, like 7?
3 answers 3