+ 2

WhaT is the purpose of return 0 ??

6th Nov 2017, 5:00 AM
Abdullah Malik
Abdullah Malik - avatar
7 ответов
+ 14
yes it will...
6th Nov 2017, 5:10 AM
Frost
Frost - avatar
+ 2
In C and C++ programs the main function is of type int and therefore it should return an integer value. 
6th Nov 2017, 2:24 PM
Shivam Negi
Shivam Negi - avatar
+ 2
Yes the program will run because during compiling your code it will return 0 autmatically
6th Nov 2017, 2:26 PM
Shivam Negi
Shivam Negi - avatar
+ 1
Frost???? will the program run without return 0??
6th Nov 2017, 5:09 AM
Abdullah Malik
Abdullah Malik - avatar
+ 1
thnks
6th Nov 2017, 5:10 AM
Abdullah Malik
Abdullah Malik - avatar
0
Actually if you have a method that isn't void (for example: int, double and etc) you must return a value, therefore​ at the latest statement you must put return 0, otherwise you get syntax error
7th Nov 2017, 3:43 PM
Amin Company
Amin Company - avatar