: void function does not return any value
: If u r simply to print out and send ctrl back to main use void.
: However if u r 2 return a value use any other reqd returntype.
:
if you are using a very very old compiler such as Turbo C, you can get way with that. Modern compilers no longer support that construct without producing either a warning or an error.
http://users.footprints.net/~kaz/cppvoidmain.html
4. The main function is required, by a diagnosable semantic rule, to
have a return type of int. This is stated in clause 3.6.1 (Main
function):
[The main function] shall have a return type of type int, but
otherwise its type is implementation-defined. Therefore, a program which
declares main to return something other than int is an ill-formed
program, because it violates a semantic constraint rule which is not
accompanied by the words ``no diagnostic is required''. Upon
processing the erroneous construct, the C++ implementation is required
to emit a diagnostic, rather than behave in an undefined manner.