<!-- hamlet
<!-- copytar
examples/                                                                                           0040755 0002611 0000666 00000000000 06355543175 0013543 5                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        examples/assignment1.c                                                                              0100644 0002611 0000666 00000000545 06355543166 0016141 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates some properties of assignment.

   Created:  Joe Zachary, September 19, 1992
   Modified:
*/

#include <stdio.h>

void main () {
  
  int w, x, y, z;

  w = 2;
  printf("w = %d\n", w);

  x = (y = 3);
  printf("x = %d, y = %d\n", x, y);

  z = (x = 15) * (y = 30);
  printf("x = %d, y = %d, z = %d\n", x, y, z);

}
                                                                                                                                                           examples/if1.c                                                                                      0100644 0002611 0000666 00000000706 06355543153 0014362 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates some properties of if-then-else

   Created:  Joe Zachary, September 19, 1992
   Modified:
*/

#include <stdio.h>

void main () {
  
  int x = 0;

  printf("Please enter an integer: ");
  scanf("%d", &x);

  if (x == 0)
    {
      printf("Zero\n");
    }
  else if (x == 1)
    {
      printf("One\n");
    }
  else if (x == 2)
    {
      printf("Two\n");
    }
  else
    {
      printf("Unknown\n");
    }
}
                                                          examples/while1.c                                                                                   0100644 0002611 0000666 00000000404 06355543160 0015065 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates some properties of while loops.

   Created:  Joe Zachary, September 19, 1992
   Modified:
*/

#include <stdio.h>

void main () {
  
  int x = 0;

  while (x < 5) {
    printf("x = %d\n", x);
    x = x + 1;
  }
    
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            