What does return 0; do at the end of the main function?
– Not much. Let’s first review what return does. In a function, return gives a value back to the calling expression. For example, if you wrote a function called squareroot that had return root; at the end of it, then f=squareroot(4); would call squareroot, and the value of root would be put into the variable f. If a program has return 0; at the end of its main routine, the 0 is returned to whatever called the program. To see this in action, open a Terminal window. We’re going to use a program (written in C) called ls. It lists files and also returns a value. Type ls to see what files are in the current folder. Suppose file1 exists, but file2 doesn’t.