When to use return(0) and return(x)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When to use return(0) and return(x)?

here x= any value

24th Jun 2016, 4:47 AM
Parth Parekh
Parth Parekh - avatar
2 Answers
+ 2
return 0 is when you want to end the execution, return x is when you wants to return value to that function. Void
24th Jun 2016, 10:39 AM
Justin Tan C S
Justin Tan C S - avatar
- 1
void does not return anything
25th Jun 2016, 7:30 AM
Rick Yuzuriha
Rick Yuzuriha - avatar