What is the difference between return 0 and return -1 in c?

1 answer

Answer

1252593

2026-04-17 14:05

+ Follow

If we consider any function that is not the main function that is declared as "bool" i.e it will return boolean values to the main function-0 & 1, meaning 'false' and 'true' respectively.

If we have to tell the main function that the condition checked in the function is false or disagreed, then we return 0 to the main function and when we have to tell that the condition checked in the main function is true or agreed, then we return 1 to the main function.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.