Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- unsigned basechange(unsigned n, unsigned x)
- {
- if(n==0)
- return n;
- else
- return (n%10)*pow(16, x)+basechange(n/10, x+1);
- }
- int main()
- {
- printf("%d", basechange(312, 0));
- return 0;
- }
Add Comment
Please, Sign In to add comment