Java - To Binary And Hexa

Description

To Binary And Hexa

Demo

import java.util.Scanner;

public class ToBinaryAndHexa {
    public static void main(String[] args) {


        int n = 120;
        System.out.println(Integer.toString(n,2));
        System.out.print(Integer.toString(n,16));
    }/*from w w  w  .ja v  a  2  s.  c  om*/
}

Related Topic