Main.cc: In function 'bool p(int)': Main.cc:4:26: error: 'x' was not declared in this scope for(int i = 2;i*i <= x;i++){ ^