<!-- hamlet
<!-- copytar
examples/                                                                                           0040755 0002611 0000666 00000000000 06355543513 0013537 5                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        examples/addresses.c                                                                                0100644 0002611 0000666 00000001552 06355543501 0015655 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program displays the sizes of variables in bytes

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

#include <stdio.h>

void main () {
  
  char a;            /* Holds a character */
  short b;           /* Holds a short integer */
  int c;             /* Holds an integer */
  long d;            /* Holds a long integer */
  float e;           /* Holds a floating point number */
  double f;          /* Holds a double precision floating point */
  long double g;     /* Holds a long double precision floating point */

  printf("a: location %u\n", (unsigned) &a);
  printf("b: location %u\n", (unsigned) &b);
  printf("c: location %u\n", (unsigned) &c);
  printf("d: location %u\n", (unsigned) &d);
  printf("e: location %u\n", (unsigned) &e);
  printf("f: location %u\n", (unsigned) &f);
  printf("g: location %u\n", (unsigned) &g);

}

                                                                                                                                                      examples/and.c                                                                                      0100644 0002611 0000666 00000000600 06355543502 0014434 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates the difference between logical
   and bitwise operators.

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

#include <stdio.h>

void main () {
  
  int a = 1;
  int b = 2;

  int result1 = a && b;
  int result2 = a & b;

  printf("The result of (a && b) is %d\n", result1);
  printf("The result of (a & b) is %d\n", result2);

}

                                                                                                                                examples/char1.c                                                                                    0100644 0002611 0000666 00000000714 06355543502 0014676 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates some properties of characters.

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

#include <stdio.h>

void main () {
  
  char a = 'H';
  char b = 'e';
  char c = 'l';
  char d = 'l';
  char e = 'o';

  printf("Printing the characters as integers: ");
  printf("%d %d %d %d %d\n\n", a, b, c, d, e);

  printf("Printing the characters as characters: ");
  printf("%c %c %c %c %c\n", a, b, c, d, e);

}
    
                                                    examples/char2.c                                                                                    0100644 0002611 0000666 00000000713 06355543503 0014677 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates some properties of characters.

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

#include <stdio.h>

void main () {
  
  char a = 72;
  char b = 101;
  char c = 108;
  char d = 108;
  char e = 111;

  printf("Printing the characters as integers: ");
  printf("%d %d %d %d %d\n\n", a, b, c, d, e);

  printf("Printing the characters as characters: ");
  printf("%c %c %c %c %c\n", a, b, c, d, e);

}
    
                                                     examples/convert.c                                                                                  0100644 0002611 0000666 00000000442 06355543504 0015360 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program illustrates arithmetic conversions.

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

#include <stdio.h>

void main () {
  
  int a = 5;
  float b = 5.0;

  printf("The result of a*b is %d\n", a*b);
  printf("The result of a*b is %f\n", a*b);

}

                                                                                                                                                                                                                              examples/sizes.c                                                                                    0100644 0002611 0000666 00000001530 06355543503 0015033 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 1 */
/* This program displays the sizes of variables in bytes

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

#include <stdio.h>

void main () {
  
  char a;            /* Holds a character */
  short b;           /* Holds a short integer */
  int c;             /* Holds an integer */
  long d;            /* Holds a long integer */
  float e;           /* Holds a floating point number */
  double f;          /* Holds a double precision floating point */
  long double g;     /* Holds a long double precision floating point */

  printf("char: %d bytes\n", sizeof(a));
  printf("short: %d bytes\n", sizeof(b));
  printf("int: %d bytes\n", sizeof(c));
  printf("long: %d bytes\n", sizeof(d));
  printf("float: %d bytes\n", sizeof(e));
  printf("double: %d bytes\n", sizeof(f));
  printf("long double: %d bytes\n", sizeof(g));

}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        