int tab[5]={1,2,3,4,5}; int resultat = 0; void main() { int compteur=5; int acc=0; int i=0; while( compteur > 0 ) { acc = acc + tab[i]; i=i+1; compteur = compteur - 1; } resultat = acc; }