1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Programme conversion
choix : caractère
hexa : chaine
nb, k : entier
debut
//boucle sur le menu
Choix ← Z
Tantque choix <> Q et choix <> q
//menu
Afficher conversion decimal vers hexadecimal
1
Afficher conversion hexadecimal vers decimal
.2
Afficher quitter
.Q
Saisir choix
//conversion entier vers hexadecimal
Si choix = 1 alors
Hexa ←
Afficher entrer un entier =
Saisir nb
Tantque nb <> 0
hexa ←str(nb mod 2) + hexa
nb ←nb div 16
fin tantque
afficher conversion en hexadecimal = + hexa
sinon
//conversion hexadecimal vers decimal |
Partager