A voir également:
- Convertion
- Convertion mp4 - Télécharger - Conversion & Codecs
- Convertion pdf - Guide
- Youtube convertion - Télécharger - Conversion & Codecs
- Monnaie convertion - Télécharger - Banque & Budget
- Convertion en mp3 - Télécharger - Conversion & Extraction
1 réponse
Bonjour, un petit exemple :)
#include <stdio.h>
int main()
{
long int decimalNumber, remainder, quotient;
int i = 1, j, temp;
char hexadecimalNumber[100];
printf("decimal ? : ");
scanf("%ld", &decimalNumber);
quotient = decimalNumber;
while (quotient != 0) {
temp = quotient % 16;
if (temp < 10)
temp = temp + 48; else
temp = temp + 55;
hexadecimalNumber[i++] = temp;
quotient = quotient / 16;
}
printf("hexadecimal : ");
for (j = i - 1; j> 0; j--)
printf("%c", hexadecimalNumber[j]);
printf("\n");
return 0;
}
#include <stdio.h> int main(void) { unsigned int n = 2017; printf("Le nombre '%d' en décimal équivaut à '%X'" " en hexadécimal\n", n, n); return 0; }donne :
Dal