dancidenis

lab6p3

Nov 9th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. unsigned basechange(unsigned n, unsigned x)
  5. {
  6. if(n==0)
  7. return n;
  8. else
  9. return (n%10)*pow(16, x)+basechange(n/10, x+1);
  10. }
  11.  
  12. int main()
  13. {
  14. printf("%d", basechange(312, 0));
  15.  
  16. return 0;
  17. }
Add Comment
Please, Sign In to add comment