write a program in Java to enter octal number to decimal
Answers
Answered by
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
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