Originally Posted by
grumpy
Have you bothered to read the error messages from your compiler? Even an antique compiler like TC++3 will give you sensible diagnostics on that code.
The curly braces associated with the mul() function are misplaced. In C++, it is necessary to specify that main() returns int (a C compiler lets you get away not doing that, a C++ compiler does not), and it is necessary to #include <stdio.h> in order to use printf(). And the function mul() needs to be declared (a "prototype" as a minimum) before code that calls it.