Advertisement
shuvocse

Number System OF PHP

Aug 26th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2.  
  3. $n = 12;
  4. $o = 017;
  5. $h = 0x1B;
  6.  
  7. printf("The number is %d and %d and %d", $n, $o, $h);
  8.  
  9. echo "<br/>";
  10.  
  11. printf("The binary equivalent of %d is %b",12,12);
  12.  
  13. echo "<br/>";
  14.  
  15. printf("The hexadeciman equivalent of %d is %x",1212,1212);
  16.  
  17. echo "<br/>";
  18.  
  19. printf("The octal equivalent of %d is %o",1212,1212);
  20.  
  21. echo "<br/>";
  22.  
  23. printf("octal %o = %d",0200000,0200000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement