New course! Every coder should learn Generative AI!
Try a free lesson+ 1
no return type in main()
here there is no "return 0" in main function
3 Answers
+ 2
By Default the return type of main() function is int . So you have to return 0 . Or there will be showing an error.
+ 2
Apart from that its special function and all other functions are finally ending up there and vice versa so typing return 0 is not necessary in some compilers
or
###### compiler will complain: ######
RETURN TYPE ERROR IN MAIN()
0
return 0 in the main function isn't always needed but you should use it to make sure 0 is returned and an error did not come up.