What is the difference in using void main() and int main() functions?? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

What is the difference in using void main() and int main() functions??

just wanted to know this basic thing

18th Feb 2018, 5:42 PM
Srikumar K
Srikumar K - avatar
2 Réponses
0
void main(), states that the main function will return nothing in the end of execution. int main(), states that the main function will return an integer value in the end of execution. Therefore you've to write "return 0;" in the end where 0 is an integer. If you don't, the program will return any garbage int value in the end.
18th Feb 2018, 5:52 PM
Harjeet Singh
Harjeet Singh - avatar