+ 5
What is the difference between void main and int main and what is the difference when same code will excute ..
3 Answers
+ 3
void will not return anything and int will return an integer number
+ 2
anything before main will determine the return value upon sucessful completion of the program. int main will return an integer, void main will not return anything.
0
int main returns a value and void main doesn't .
The difference in between this two is that int main will allow you to know whether a program has successfully terminated or not as it returns a value to OS ,the returned value may be zero or non zero.
generally int main is recommended over void main, Also using void doesn't do bad too.