It will return an integer and it may not the one you want in another case or with future compilers. Your compiler should have given a warning if there was no return statement.
A simpler way,
The program will run, but it won't give the correct answer.
If you omit line 7, the program will compile with a warning, but the cout won't be correct.
The function will return 0, which of course, is not the result of adding 1+2.