Created
August 7, 2019 22:30
-
-
Save parzibyte/df13438ff94d5eb02e80d17744126c72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
// El número que el usuario va a ingresar | |
unsigned long long int decimal = 0; | |
// Una cadena de máximo 63 bits, o sea longitud 63 | |
char cadena[63]; | |
printf("Ingresa un numero decimal:\n"); | |
scanf("%llu", &decimal); | |
/* | |
ltoa e itoa no regresan nada; modifican directamente a la variable | |
El último argumento es la base: 16 en este caso | |
*/ | |
ltoa(decimal, cadena, 16); | |
printf("El numero en hexadecimal es: %s\n", cadena); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment