Home Segments Index Top Previous Next

179: Mainline

The following expression, for example, evaluates to 1 only if the value of the ratio variable is between 10 and 30:

10 < ratio && ratio < 30 

Accordingly, the printf statement embedded in the following if statement is evaluated only if the value of the ratio variable is in the 10-to-30 range.

if (10 < ratio && ratio < 30) 
  printf ("It is in the normal range.\n");