It can't be compiled in C++ or modern C (missing return type), and it can't be compiled in the ancient C89, where this f1 returns int, because "//" was not a valid comment.
In any case, falling off the end of a value-returning function without a return statement has always been undefined behavior.
not in c, c + + but, first declaring data type returned by the function "f1".
missing the "# include <xxxxx>" "using namespace std;" the loop "while" is misspelled ...
should do the code again