<!-- hamlet
<!-- copytar
examples/                                                                                              755    1107     172            0  5656521362   5713                                                                                                                                                                                                                                                                                                                                                                      examples/float.c                                                                                       644    1107     172          631  5656521342   7227                                                                                                                                                                                                                                                                                                                                                                      /* This program repeatdly prompts for a floating-point number and then
   prints it back out. */

#include <stdio.h>

void main () {

  float x;
  char remainder[200];

  /* This program loops forever.  It must be interrupted from the
     keyboard with Ctrl-C. */

  while (1) {

    printf("Please enter a floating-point number: ");
    scanf("%g", &x);
    printf("%g\n", x);
    gets(remainder);

  }

}

                                                                                                       examples/joints.c                                                                                      644    1107     172         3105  5656521334   7450                                                                                                                                                                                                                                                                                                                                                                      
/* This is the file "joints.c". */

/*
 * This program determines the position of a squatter's knee joint in the
 * X-Y plane.  The (X, Y) position of the ankle joint is already known.  The
 * length of the shin is also known.  The angle of the ankle joint, measured
 * in degrees counterclockwise from the positive X axis, is typed in by the
 * user.
 */

#include <stdio.h>
#include <math.h>

void main()
{
  /* `ankle_x' and `ankle_y' are the X and Y coordinates of the ankle joint. */
  /* `shin_length' is the length of the squatter's shin, in meters. */
  
  /* `theta_degrees' is the angle of the ankle joint, measured in degrees. */
  /* `theta_radians' is the angle of the ankle joint, measured in radians. */
  
  /* `knee_x' and `knee_y' are the X and Y coordinates of the knee joint. */
  
  float pi;
  float ankle_x, ankle_y;
  float shin_length;
  float theta_degrees, theta_radians;
  float knee_x, knee_y;
  
  /* Set up the known values. */
  
  pi = 3.14159;
  ankle_x = 0.0;
  ankle_y = 0.04;
  shin_length = 0.405;
  
  /* Get the angle of the ankle joint from the user, and convert to radians. */
  
  printf("Enter the angle of the ankle joint (in degrees): ");
  scanf("%f", &theta_degrees);
  theta_radians = theta_degrees * (pi / 180.0);
  
  /* Determine the (X, Y) position of the knee joint and print it. */
  
  knee_x = ankle_x + (shin_length * cos(theta_radians));
  knee_y = ankle_y + (shin_length * sin(theta_radians));
  printf("The X coordinate of the knee joint is %f\n", knee_x);
  printf("The Y coordinate of the knee joint is %f\n", knee_y);
}

/* End of file. */
                                                                                                                                                                                                                                                                                                                                                                                                                                                           examples/integer.c                                                                                     644    1107     172          575  5656521351   7566                                                                                                                                                                                                                                                                                                                                                                      /* This program repeatdly prompts for an integer and then
   prints it back out. */

#include <stdio.h>

void main () {

  int n;
  char remainder[200];

  /* This program loops forever.  It must be interrupted from the
     keyboard with Ctrl-C. */

  while (1) {

    printf("Please enter an integer: ");
    scanf("%d", &n);
    printf("%d\n", n);
    gets(remainder);

  }

}

lude <math.h>

void main()
{
  /* `ankle_x' and `ankle_y' are the X and Y coordinates of the ankle joint. */
  /* `shin_length' is                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 