CODING:
public class ConvertBinaryToDecimalNumber
{
public static void main(String[] args)
{
String strBinaryNumber = "111000";
int decimalNumber = Integer.parseInt(strBinaryNumber,2);
System.out.println("Binary number converted to decimal number");
System.out.println("Decimal number is : " + decimalNumber);
}
}
OUTPUT:
public class ConvertBinaryToDecimalNumber
{
public static void main(String[] args)
{
String strBinaryNumber = "111000";
int decimalNumber = Integer.parseInt(strBinaryNumber,2);
System.out.println("Binary number converted to decimal number");
System.out.println("Decimal number is : " + decimalNumber);
}
}
OUTPUT:
Binary number converted to decimal number
Decimal number is : 56
Binary number converted to decimal number
Decimal number is : 56
Comments
Post a Comment