Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Viet chuong trnh chuyen doi he so 10 sang 16
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int a[100],n;
- int x;
- int k=0;
- char b[16]={'0','1','2','3','4','5','6','7','8','9','A'
- ,'B','C','D','E','F'};
- scanf("%d",&n);
- while(n>0)
- {
- k++;
- x=n%16;
- a[k]=x;
- n=n/16;
- }
- for(int i=k;i>0;i--)
- {
- printf("%c ",b[a[i]]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement