Main.cc:17:2: error: expected unqualified-id before ‘else’ else gcd(y,x%y); ^~~~ Main.cc:18:1: error: expected declaration before ‘}’ token } ^ Main.cc: In function ‘int gcd(int, int)’: Main.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type] } ^