Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // calculer somme des chiffres pairs d'un nombre N
- var N,s,x;
- ecrire("Donner N: "); lire(N);
- s <- 0;
- tant que N != 0 faire
- x <- N%10;
- si x%2=0 alors s <- s + x; fin si
- N <- (N - x)/10;
- fin tant que
- ecrire("La SoMmE dEs ChIfFrEs PaIrS eSt: ",s);
Advertisement
Add Comment
Please, Sign In to add comment