Return 0 | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antworten
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