home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / sphinx / examples / other / loops.c__ < prev    next >
Encoding:
Text File  |  1993-04-30  |  505 b   |  30 lines

  1. /*
  2.      SPHINX C-- Program that demonstrates the two looping structures of C--
  3. */
  4.  
  5. ?include "WRITE.H--"
  6.  
  7. main ()
  8. int count;        /* loop counter */
  9. {
  10. WRITESTR("SPHINX C-- loop demo started.\n");
  11.  
  12. WRITESTR("\nStart loop:        ");
  13. count = 20;
  14. loop(count)
  15.     {WRITEWORD(count);
  16.     WRITE(' ');
  17.     }
  18.  
  19. WRITESTR("\nStart do {} while: ");
  20. count = 20;
  21. do {WRITEWORD(count);
  22.     WRITE(' ');
  23.     count--;
  24.     } while( count > 0);
  25.  
  26. WRITESTR("\n\nDone.");
  27. }
  28.  
  29.  
  30. /* end of LOOPS.C-- */