Main.cc: In function 'int main()': Main.cc:19:25: warning: format '%d' expects a matching 'int' argument [-Wformat=] } printf("%d\n%d",r2); ^ Main.cc:20:13: error: expected '}' at end of input return 0; ^