Return a zero and terminate

The return statement in Listing 7 returns a value of zero.

By convention this indicates that the program terminated properly.

Then the main function terminates, causing the program to terminate.

Listing 7. Return a zero and terminate.
  return 0;//Return 0 to indicate a successful run.
}//end main function