4
Make a program to read an array A of type vector with 15 elements. Construct an array B of the same type, each element of matrix B being the factorial of the corresponding element of matrix A . Display matrices A and B.
I tried to make people but something is wrong and I can’t see what it is, if anyone can point out the mistake I appreciate and already thanks for the help...
int matriza[5], matrizb[5], matrizc[5], indice, cont = 0, soma = 0;
for(indice = 1; indice <= 5; indice++)
{
printf("\n digite um valor: ");
scanf("%d",&matriza[indice]);
}
cont = matriza[indice];
for(soma = 1; cont >= 1; cont = cont - 1)
{
soma = soma * cont;
matrizb[indice] = soma;
}
for(indice = 1; indice <= 5; indice++)
{
printf("\n O valor do vetor B e: %d \n", matrizb[indice]);
}
You need to calculate the factorial of each vector value?
– DaviAragao