home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / INTRO20.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  496 b   |  31 lines

  1. /* INTRO20.C--Example from Chapter 4 of Getting Started */
  2.  
  3. #include <stdio.h>
  4.  
  5. #define WARNING -1
  6.  
  7. int get_status(void)
  8. {
  9.    return WARNING;
  10. }
  11.  
  12. int main()
  13. {
  14.    int count = 10;
  15.    while (count-- > 1)
  16.    {
  17.       if (get_status() == WARNING)
  18.          break;
  19.       printf("%d\n", count);
  20.    }
  21.    if (count == 0)
  22.       printf("Shuttle launched\n");
  23.    else
  24.    {
  25.       printf("Warning received\n");
  26.       printf("Count down held at t - %d", count);
  27.    }
  28.  
  29.    return 0;
  30. }
  31.