Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

binary to octal conversion java program

// conversion of binary to octal in java..
public class Main{
    public static void main(String args[]) throws Exception{
        String binary = "1100100";                // binary number.. 
        int decimal = Integer.parseInt(binary,2); // converting binary to decimal
        System.out.println(Integer.toOctalString(decimal)); // 144 <= octal output..  
    }
}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #binary #octal #conversion #java #program
ADD COMMENT
Topic
Name
9+5 =