Can ANYONE find a mistake in this! I cant seem to make it work! (nevermind the french comments...)
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int Imprimer_Menu();
void Execute_Test(int operande1[], int operande2[], int reponse[], int operation, int taille);
void Imprimer_Resultat(int operande1[], int operande2[], int reponse[], int operation, int taille);
int main(){
int OPERATION, TAILLE;
TAILLE=10;
int Op1[TAILLE], Op2[TAILLE], Rep[TAILLE];
printf(printf("Ce programme vous aidera %c pratiquer vos multiplications et vos divisions\n", 133);
do{
OPERATION=Imprimer_Menu(); /*Appel de la fonction Imprimer_Menu*/
Execute_Test(Op1, Op2, Rep, OPERATION, TAILLE); /*Appel de la fonction Execute_Test*/
Imprimer_Resultat(Op1, Op2, Rep, OPERATION, TAILLE); /*Appel de la fonction Imprimer_Resultat*/
system("PAUSE");}
while (OPERATION==1 || OPERATION==2);
return(0);
}
int Imprimer_Menu(){
int choix;
do {
printf("\nMenu 1)Multiplication\n 2)Division\n 3)Sortie\n");
printf("Veuillez choisir une option:");
scanf("%d", choix);}
while(choix>3 || choix<1);
return(choix);}
void Execute_Test(int operande1[], int operande2[], int reponse[], int operation, int taille){
int i;
time_t t;
srand(time(&t));
if (operation==1){
printf("\nR%cpondez aux 10 multiplications suivantes\n", 130);
for(i=0; i<taille; i++) {
operande1[i]=1+rand()%9;
operande2[i]=1+rand()%9;
printf("\n%d X %d=", operande1[i], operande2[i]);
scanf("%d", reponse[i]);}}
else if(operation==2){
printf("\nR%cpondez aux 10 divisions suivantes\n", 130);
for(i=0; i<taille; i++){
operande1[i]=1+rand()%9;
do{
operande2[i]=1+rand()%9;}
while((operande1[i]%operande2[i])!=0);
printf("\n%d / %d=", operande1[i], operande2[i]);
scanf("%d", reponse[i]);}}
else exit(EXIT_FAILURE);
}
void Imprimer_Resultat(int operande1[], int operande2[], int reponse[], int operation, int taille){
int score, i;
score=0;
if (operation==1){
for(i=0; i<taille; i++){
if(reponse[i]=(operande1[i]*operande2[i])){
printf("\n%d X %d = %d - r%cponse correcte", operande1[i], operande2[i], reponse[i], 130);
score++;
}
else
printf("\n%d X %d = %d - r%cponse incorrect, la bonne r%ponse est %d", operande1[i], operande2[i], reponse[i], 130, 130, operande1[i]*operande2[i]);}
}
else{
for(i=0; i<taille; i++){
if(reponse[i]=(operande1[i]/operande2[i])){
printf("\n%d / %d = %d - r%cponse correcte", operande1[i], operande2[i], reponse[i], 130);
score++;
}
else
printf("\n%d / %d = %d - r%cponse incorrect, la bonne r%ponse est %d", operande1[i], operande2[i], reponse[i], 130, 130, operande1[i]/operande2[i]);}
if(score>7)
printf("\nF%clicitations!", 130);
else
printf("\nVeuillez demander de l'aide %c votre enseignant(e)!", 133);
printf("\nVotre score est de %d/%d", score, taille);
}
}