mirror of
https://codeberg.org/DansLeRuSH/c-plus-plus-exercises.git
synced 2024-11-23 19:58:09 +00:00
Convert an integer to decimal, octal and hexadecimal
This commit is contained in:
parent
5ce3e38153
commit
6dcbeb9cf1
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