Skip to content

Instantly share code, notes, and snippets.

@cbourke
Created October 17, 2018 14:53
Show Gist options
  • Select an option

  • Save cbourke/0fb8045a42ad38c4de10934270acd1eb to your computer and use it in GitHub Desktop.

Select an option

Save cbourke/0fb8045a42ad38c4de10934270acd1eb to your computer and use it in GitHub Desktop.
auto-posted gist
#include<stdlib.h>
#include<stdio.h>
#include "array_utils.h"
int main(int argc, char **argv) {
int n = 5;
int a[] = {1, 6, 7, 2, 3};
int b[] = {9, 4, 2, 5, 2};
int d;
int err = dotProduct(a, b, n, &d);
if(err) {
printf("There were an error.\n");
} else {
printf("dot product = %d\n", d);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment