fn calculate_dot_product(arr1: &[i32], arr2: &[i32]) -> i32 {
let mut product = 0;
let size = arr1.len();
for i in 0..size {
product += arr1[i] * arr2[i];
}
product
}
fn main() {
let arr1 = [1, 4, 8, 9, 6];
let arr2 = [0, 7, 1, 3, 40];
println!("Dot product = {}", calculate_dot_product(&arr1, &arr2));
}
/*
run:
Dot product = 303
*/