Very interesting

hamidzaza Messages postés 2 Date d'inscription   Statut Membre Dernière intervention   -  
hamidzaza Messages postés 2 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
g un ptt probleme d'écrire cet algorithme: bon qui permet se saisir d'abord une liste de 30 notes d'élèves , puis qui affiche la note maximale.

2 réponses

Nkunzis Messages postés 10 Date d'inscription   Statut Membre Dernière intervention  
 
salut

1.Initialize an array of 30 element like int grades[30] and int grade to hold given grade from the user
2. Make a dialog mesage with the user to get grades from him:

int i=0;
while (i > 30){
printf(''Enter grade: ");
scanf("%d",&grade);
grade[i]=grade;
i++;
}


3. After storing all grade in the array, then start comparing them to get the maximum(highest result).
int max=grades[0];
for(int j=0; j < i ; j++){
if(max<grade[j]){
max=grade[j];
}
}

4. The value is max will be the highest note


cheers.
0
hamidzaza Messages postés 2 Date d'inscription   Statut Membre Dernière intervention  
 
groos merci
mais je vx la solution avec tableau plzzz
:):):)
0