Q:

Is there a better way to determine multiple ranges of character?

I'm currently writing code in C, which selects symbols and numbers from whole ASCII-available characters.
As a beginner of programmer, I usually did
if ((i > 25 && i < 50) || (i > 100 && i < 200)) { contents } 

for the variable i being between 25~50, 100~200 (exclusive) to fit the condition.
If I want to set multiple ranges like 32~64(! to @) and 91~96([ to `) and 123~126({ to ~) then would there be any better (meaning shorter or simpler code) or should I stick with this method, keep adding each range as in the code above?

A:

For your specific case, the <ctype.h> collection of functions would do 
if (isprint(i) && !isalpha(i))

Added bonus: It even works on non-ascii systems.

