Very interesting

Fermé
hamidzaza Messages postés 2 Date d'inscription mercredi 24 octobre 2007 Statut Membre Dernière intervention 25 octobre 2007 - 24 oct. 2007 à 23:35
hamidzaza Messages postés 2 Date d'inscription mercredi 24 octobre 2007 Statut Membre Dernière intervention 25 octobre 2007 - 25 oct. 2007 à 00:04
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 lundi 6 mars 2006 Statut Membre Dernière intervention 2 juin 2009
24 oct. 2007 à 23:48
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 mercredi 24 octobre 2007 Statut Membre Dernière intervention 25 octobre 2007
25 oct. 2007 à 00:04
groos merci
mais je vx la solution avec tableau plzzz
:):):)
0