Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int d,r,i,j=0;
- char h[100];
- scanf("%d", &d);
- while(d>0)
- {
- r=d%16;
- if(r<10) h[j]=48+r;
- else h[j]=55+r;
- d=d/16;
- j++;
- }
- for(i=j-1;i>=0;i--) printf("%c", h[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement