load two vectors of 8 elements each and in a 3rd vector multiplication. Calculate the average of that vector, generate a function that receives the average value and return the same divided by 2.
load two vectors of 8 elements each and in a 3rd vector multiplication. Calculate the average of that vector, generate a function that receives the average value and return the same divided by 2.
Here is if the code only passes to functions that you occupy and already this
#include <stdio.h>
#include <stdlib.h>
#define tam 8
main(){
int a [tam],b [tam],c [tam], i, j,m,r,total;
system("cls");
printf("\Multiplicación De Matrices\n");
/*** Introduces Valores A Los Vectores ***/
printf("Matriz 1\n");
for(i=0;i<tam;i++){
printf("Por favor el elemento %d \n ", i+1);
scanf("%d",&a[i]);
system("cls");
}
system("cls");
printf("Vector 2\n");
for(i=0;i<tam;i++){
printf("Por favor el elemento %d \n ", j+1);
scanf("%d",&b[i]);
system("cls");
}
system("cls");
/*** Aqui tienes la multilicacion en un tercer vector ***/
for(i=0;i<tam;i++){
c[i] = a[i] * b[i];
}
/*** Aqui Tenemos El Promedio ***/
for(i=0;i<tam;i++){
total = c[i] + total;
}
total=total/tam;
/*** Aqui ya tienes divido entre dos ***/
total=total/2;
}