Computer Science, asked by snehatoppo48, 8 months ago

write a program in Java to enter octal number to decimal​

Answers

Answered by giriaishik123
0

Answer:

Explanation:

public class JavaExample{    

  public static void main(String args[]) {

//octal value

String onum = "157";

 

//octal to decimal using Integer.parseInt()

int num = Integer.parseInt(onum, 8);

 

System.out.println("Decimal equivalent of Octal value 157 is: "+num);

  }

}

Answered by bhoopbhoomi3088
2

Answer:

Java Convert Octal to Decimal

//Java Program to demonstrate the use of Integer.parseInt() method.

//for converting Octal to Decimal number.

public class OctalToDecimalExample1{

public static void main(String args[]){

//Declaring an octal number.

String octalString="121";

//Converting octal number into decimal.

Similar questions