Main.cc: In function 'int main()': Main.cc:15:5: error: 'n' was not declared in this scope if(n%i==0 and m%i==0){ ^ Main.cc:15:16: error: 'm' was not declared in this scope if(n%i==0 and m%i==0){ ^