Return 0 | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Return 0

The answer to this is 45 but in the code its return 0 So why would code run to give a number i.e 45 when it is to be returned 0?

3rd Mar 2020, 6:10 AM
San Ket
San Ket - avatar
3 Respostas
0
That return 0 is returned to operating system. Not to console output. Program outputs displayed on console output. Returned statements returned to calling functions. OS expects a value from Program to determine program status. Generally return 0 means Program successfully executed and otherthan zero means Program exited with errors... Hoping this helps you.
3rd Mar 2020, 7:14 AM
Jayakrishna šŸ‡®šŸ‡³
+ 1
What about you are taking? About your code calculations or at end return 0?
3rd Mar 2020, 6:57 AM
Jayakrishna šŸ‡®šŸ‡³
0
About return 0
3rd Mar 2020, 6:58 AM
San Ket
San Ket - avatar