+ 5

What is the difference between void main and int main and what is the difference when same code will excute ..

30th Apr 2017, 8:44 AM
P∆WAN M∆URY∆
P∆WAN M∆URY∆ - avatar
3 Answers
+ 3
void will not return anything and int will return an integer number
30th Apr 2017, 8:56 AM
chris
chris - avatar
+ 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.
30th Apr 2017, 9:34 AM
Krishneel Nair
Krishneel Nair - avatar
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.
30th Apr 2017, 9:24 AM
Shiva Gaire