mirror of
https://codeberg.org/DansLeRuSH/c-plus-plus-exercises.git
synced 2024-11-25 12:48:08 +00:00
Convert an integer to decimal, octal and hexadecimal
This commit is contained in:
parent
d42e6068ed
commit
bac9c8cf86
1 changed files with 13 additions and 0 deletions
13
EX02_conversion_entier.cpp
Normal file
13
EX02_conversion_entier.cpp
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
//Auteur : Franck ALBARET
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
int Entier;
|
||||||
|
puts ("Entrer un entier :");
|
||||||
|
scanf ("%i",&Entier);
|
||||||
|
printf("L'écriture décimale de l'entier est %i\n",Entier);
|
||||||
|
printf("L'écriture octale de l'entier est %o\n",Entier);
|
||||||
|
printf("L'écriture hexadécimale de l'entier est %x\n",Entier);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue