Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char **argv) {
  4.         int x = 132;
  5.         int base = 8;
  6.         int baseMax = 1;
  7.         while (x/(baseMax*base) >= 1) {
  8.                 baseMax *=base;
  9.         }
  10.         baseMax *=base;
  11.  
  12.         do {
  13.                 baseMax /= base;
  14.                 char value = (x/baseMax) % base + 0x30;
  15.                 putc(value, stdout);
  16.         } while(baseMax > 1);
  17.         return x;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement