You can't print the values from 1 to 31 is that they are non printable characters, for example NUL, SOH, BS.
Here is a ASCII chart for your reference ASCII Chart for C
Use this for loop
for( int i = 32; i<127; i++){
printf("%c ", i);
This prints all the printable ASCII character separated by space.