More Flow of Control Getting Ready Please open a telnet session on the cs machine and log on. We'll put some programs in this directory a little later. This lab is partly a review of previous techniques and an introduction of a few alternatives. We'll also work with functions which return logical values as a way of cleaning up our logic.
Logical Expressions Let's review logical expressions first.
You'll see when we cover strings that this interpretation will make our life easier. Since it's not zero, it is taken as true. While any nonzero value can be used for true, when a logical expression is calculated as true, its value is 1. Functions that Return a Logical Value Functions can be used to return a logical value. Since 0 will be returned for false and 1 for true, such functions are declared as int .