<!-- hamlet
<!-- copytar
examples/                                                                                           0040755 0002611 0000666 00000000000 06032335101 0013517 5                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        examples/separate2/                                                                                 0040755 0002611 0000666 00000000000 06355552331 0015423 5                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        examples/separate2/help.c                                                                           0100644 0002611 0000666 00000001026 06355552327 0016520 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Used to illustrate separate compilation

Created:  Joe Zachary, October 22, 1992
Modified:

*/


/* Requires that "n" be positive.  Returns the sum of the
   first "n" integers. */

int sum (int n) {
  int i;
  int total = 0;
  for (i = 1; i <= n; i++)
    {
      total += i;
    }
  return(total);
}


/* Requires that "n" be positive.  Returns the product of the
   first "n" integers. */

int product (int n) {
  int i;
  int total = 1;
  for (i = 1; i <= n; i++)
    {
      total *= i;
    }
  return(total);
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          examples/separate2/help.h                                                                           0100644 0002611 0000666 00000000453 06032335101 0016505 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* Header file for "help.c"

Created:  Joe Zachary, October 22, 1992
Modified:

*/


/* Requires that "n" be positive.  Returns the sum of the
   first "n" integers. */

int sum (int n);


/* Requires that "n" be positive.  Returns the product of the
   first "n" integers. */

int product (int n);
                                                                                                                                                                                                                     examples/separate2/main.c                                                                           0100644 0002611 0000666 00000000552 06355552326 0016516 0                                                                                                    ustar 00hamlet                          hamlet                          0000235 0000202                                                                                                                                                                        /* level 2 */
/* Used to illustrate separate compilation.

Created:  Joe Zachary, October 22, 1992
Modified:

*/

#include <stdio.h>

void main () {
  int n;
  printf("Please enter a small positive integer: ");
  scanf("%d", &n);
  printf("The sum of the first n integers is %d\n", sum(n));
  printf("The product of the first n integers is %d\n", product(n));
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      