0
Why dont we put void main insted of int main
4 Answers
+ 1
C/C++ use int main to return a value to the operating system when the program is finished, so it is clear if everything is ok (return 0;) or if something unexpected happed (for example return 1;). Other languages, however, don't use this anymore.
0
so why void main is used
0
This is a problem of language design. C/C++ where designed to use int main (to give feedback to the OS) other languages (like java) have other ways to handle this and use void main instead.
0
why is getch(); used