You need 3-digits numbers. That is 100-999
You need odd numbers. That means you can generate even numbers in range 100-998 and add 1
To generate even number, generate any number and multiply by 2
To generate even number in range 100-998, generate number in range 50-499 first
Your rand expression should look like: 2 * (rand() % 449 + 50) + 1 or 2 * (rand() % 449) + 101