home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / tyc / list13_1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-16  |  415 b   |  22 lines

  1.  /* Demonstrates the break statement. */
  2.  
  3.  #include <stdio.h>
  4.  
  5.  char s[] = "This is a test string. It contains two sentences.";
  6.  
  7.  main()
  8.  {
  9.      int count;
  10.  
  11.      printf("\nOriginal string: %s", s);
  12.  
  13.      for (count = 0; s[count]!='\0'; count++)
  14.          if (s[count] == '.')
  15.          {
  16.              s[count+1] = '\0';
  17.              break;
  18.          }
  19.  
  20.      printf("\nModified string: %s", s);
  21.  }
  22.