#include <stdlib.h>
#include <stdio.h>

double dotprod(double a[], double b[], int n) {
  /* BEGIN ANSWER */

  // ADD YOUR CODE HERE

  /* END ANSWER */
}

int main() {
  int n=-1;
  printf("How many dimensions? ");
  scanf("%d",&n);
  if ( n <= 0 ) {
    printf("%d is not sensible!\n",n);
    return EXIT_FAILURE;
  }
  double *a = calloc(sizeof(double),n);
  double *b = calloc(sizeof(double),n);
  printf("Enter components of first vector (separated by spaces)\n");
  int i;
  for (i=0; i<n; i++) { scanf("%lf",a+i); }
  printf("Enter components of second vector (separated by spaces)\n");
  for (i=0; i<n; i++) { scanf("%lf",b+i); }
  printf("The dot product is %f\n",dotprod(a,b,n));
  return EXIT_SUCCESS;
}
