Please when use int main() please return int | SoloLearn: Learn to code for FREE!

+2

Please when use int main() please return int

some quiz does not return value and declare main prog as int and the question is: this prog is valid ? I select No because no return var but sololearn take the result as false :(

7/13/2017 12:33:07 PM

Chokri ZAGROUBA

2 Answers

New Answer

+11

I'm guessing you mean c++. While I agree that main should always be declared as an int, the return 0; is not necessary because the compiler will add it for you if it's missing. Happy coding!

0

thanks a lot