Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int division=1;
- void conversion (int n)
- {
- int residuo;
- if (division==0) {if ((n%16)!=0) printf("%X", n%16); else; return;}
- residuo=n%16;
- division=n/16;
- conversion(division);
- printf("%X", residuo);
- }
- int main ()
- {
- int n;
- system("clear");
- printf("\nIngrese un numero decimal: ");
- scanf("%d", &n);
- printf("\nEl numero en base hexadecimal es 0x");
- conversion(n);
- printf("\n\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement