Try removing the semicolon after for
but before the {
.
Change this:
for(int x = 1; x <= 20; x++); {
to this:
for(int x = 1; x <= 20; x++) {
The ;
ends the for
loop. What you have done in your code is have a complete for
loop followed by an unrelated block of code. The x
is only visible within the scope of the for
loop, which means up to that errant semicolon.