+ 2

return0 is it nessary

27th Aug 2017, 2:14 AM
Mostafa Dawoud
Mostafa Dawoud - avatar
6 ответов
+ 1
if u don't want to return anything then u can put 0 it's best to use void if u don't want anything to return
27th Aug 2017, 2:32 AM
corejava
+ 1
Yes, it is nessary if data type of our func. is anything except void .
27th Aug 2017, 3:48 AM
subham sahu
subham sahu - avatar
0
Already I use void no return
27th Aug 2017, 2:34 AM
Mostafa Dawoud
Mostafa Dawoud - avatar
0
yep if u don't want anything then put return 0
27th Aug 2017, 2:35 AM
corejava
0
OK thanks
27th Aug 2017, 2:35 AM
Mostafa Dawoud
Mostafa Dawoud - avatar
0
No, it ain't necessary depends upon the return type. As when we write int main (), main function must return an integer value so we write return 0; since there is nothing to return While we can avoid using it simply by giving return type void as: void main()
1st Feb 2019, 11:12 AM
AnkitKunwar
AnkitKunwar - avatar