<!-- hamlet
<!-- copytar
examples/                                                                                           0040755 0002611 0000666 00000000000 06355551036 0013536 5                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        examples/buffer2.c                                                                                  0100644 0002611 0000666 00000000464 06355551032 0015232 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Illustates the effects of buffered I/O

   Created:  Joe Zachary, October 20, 1992
   Modified: 

*/


#include <stdio.h>

void main () {
  char c;
  printf("Please enter a few characters followed by a return: ");
  c = getchar(); 
  printf("OK--I just read the first character!\n");
}
    
                                                                                                                                                                                                            examples/buffer1.c                                                                                  0100644 0002611 0000666 00000000556 06355551032 0015233 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Illustates the effects of buffered I/O

   Created:  Joe Zachary, October 20, 1992
   Modified: 

*/


#include <stdio.h>

void main () {
  char c = 'a';
  printf("Here I am at the beginning of the program!");
  printf("Here I am one line later!");
  while (1)
    {
      c = c;
    }
  printf("Here I am at the end of the infinite loop!");
}
    
                                                                                                                                                  examples/cast1.c                                                                                    0100644 0002611 0000666 00000000414 06355551033 0014706 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Illustrates casting

   Created:  Joe Zachary, October 20, 1992
   Modified: 

*/


#include <stdio.h>

void main () {
  float x;
  printf("Please enter a floating point number: ");
  scanf("%f", &x);
  printf("The integer value is %d\n", (int) x);
}
                                                                                                                                                                                                                                                    examples/cast2.c                                                                                    0100644 0002611 0000666 00000000317 06355551033 0014711 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Illustrates casting

   Created:  Joe Zachary, October 20, 1992
   Modified: 

*/


#include <stdio.h>

void main () {
  printf("Here is a string cast to be an int: %d\n", (int) "Hello");
}
                                                                                                                                                                                                                                                                                                                 examples/char.c                                                                                     0100644 0002611 0000666 00000000571 06355551034 0014615 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Illustates a detail concerning character input

   Created:  Joe Zachary, October 20, 1992
   Modified: 

*/


#include <stdio.h>

void main () {
  char c;
  int n;
  printf("Please enter an integer: ");
  scanf("%d", &n);
  printf("The integer was %d\n", n);
  printf("Now enter a character: ");
  c = getchar();
  printf("The character was %c\n", c);
}
    
                                                                                                                                       examples/cond.c                                                                                     0100644 0002611 0000666 00000000456 06355551025 0014625 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Illustrates a conditional expression.

   Created:  Joe Zachary, October 20, 1992
   Modified: 

*/


#include <stdio.h>

void main () {
  int n;
  printf("Please enter an integer: ");
  scanf("%d", &n);
  printf((n < 0) ? "The input is negative\n" : "The input isn't negative\n");
}

                                                                                                                                                                                                                  examples/repeat1.c                                                                                  0100644 0002611 0000666 00000000342 06355551034 0015235 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Illustrates how to do terminal EOF

   Created:  Joe Zachary, October 20, 1992
   Modified: 

*/


#include <stdio.h>

void main () {
  char c;
  while ((c = getchar()) != EOF)
    {
      putchar(c);
    }
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              