You had a put System.in during your if loop, not sure why. Try this

/*This program prompts the user for a number 1-20 and compares it with a
* randomly generated number. If it matches the...