Bonjour,
j'ai un petit problème avec un algorithme, je dois trouver les erreurs pour les corriger mais après plusieurs reprises mon algorithme ne marche toujours pas.
Si quelqu'un pouvait m'aider...
#include (stdio.h)
#include <lib.h>
// Fonction initTab () : Rempli un tableau avec des valeurs aléatoires comprises en 1 et 9
void initTab (int *tab, taille) {
for (i = 0; i < taille, i++) {
tab[i = (rand() % 9) + 1;
}
/* Fonction somProd () : Calcule le somProd de deux tableaux
inte somProd (int *tab1, int taille1, int *tab2, int taille2) {
int i, j, res
i = 0;
j = 0;
while i < taille1) {
while (j < taille2)
res = res + tab1[i] * tab2[j];
}
}
return res;
}
// Programme principal
int main()
{
int A, B, tab1[], tab2[2];
printf("Valeur de A : ");
scanf("%d", A);
printf("Valeur de B : );
scanf("%lf", &B);
srand(A + B)
iniTab(tab1, 4);
initTab(tab2);
printf("%d\m", somProd(4, tab1, tab2, 2) - 32000);
return 0;
}