<!-- hamlet
<!-- copytar
examples/                                                                                           0040755 0002611 0000666 00000000000 06355550555 0013543 5                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        examples/break2.c                                                                                   0100644 0002611 0000666 00000000647 06355550554 0015060 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates some properties of break statements

   Created:  Joe Zachary, October 13, 1992
   Modified:
*/

#include <stdio.h>

void main ()
{

  int input = 0;
  int total = 0;

  while (1)
    {
      printf ("Please enter a number: ");
      scanf ("%d", &input);
      if (input <= 0)
	{
	  break;
	}
      total = total + input;
    }

  printf ("The total entered was %d\n", total);

}
                                                                                         examples/break1.c                                                                                   0100644 0002611 0000666 00000000730 06355550552 0015046 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates some properties of break statements

   Created:  Joe Zachary, October 13, 1992
   Modified:
*/

#include <stdio.h>

void main ()
{

  int input = 0;
  int total = 0;
  int finished = 0;

  while (!finished)
    {
      printf ("Please enter a number: ");
      scanf ("%d", &input);
      if (input <= 0)
	{
	  finished = 1;
	}
      else
	{
	  total = total + input;
	}
    }

  printf ("The total entered was %d\n", total);

}
                                        examples/switch1.c                                                                                  0100644 0002611 0000666 00000000761 06355550553 0015270 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates some properties of switch statements

   Created:  Joe Zachary, October 13, 1992
   Modified:
*/

#include <stdio.h>

void main ()
{

  char input;

  printf ("Please enter a lower-case letter from the alphabet: ");
  scanf ("%c", &input);

  switch (input)
    {
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
      printf ("You entered a vowel\n");
      break;

    default:
      printf ("You didn't enter a vowel\n");
    }

}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               