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

main() {

  int i,N;
  double sum,arr[10];

  printf("    ====== Factorial ======\n");

  printf("Enter an integer : ");
  scanf("%d",&N);
  printf("%d! = %d\n",N,factorial(N));

  printf("\n   ====== Sum of array elements ======\n");
  printf("Enter an integer smaller than 10(size of the array) : ");
  scanf("%d",&N);
  printf("Enter the elements of the array : \n");
  for (i=0;i<N;i++) {
    printf("Element no %d : ",i+1);
    scanf("%lf",&arr[i]);
  }
  sum=sum_array(arr,N);
  printf("Sum of the elements of the array is %7.4lf\n\n",sum);
      

}

