CODING:
public class ConvertIntToBinaryExample
{
public static void main(String[] args)
{
int i = 56;
String strBinaryNumber = Integer.toBinaryString(i);
System.out.println("Convert decimal number to binary number example");
System.out.println("Binary value of " + i + " is " + strBinaryNumber);
}
}
OUTPUT:
public class ConvertIntToBinaryExample
{
public static void main(String[] args)
{
int i = 56;
String strBinaryNumber = Integer.toBinaryString(i);
System.out.println("Convert decimal number to binary number example");
System.out.println("Binary value of " + i + " is " + strBinaryNumber);
}
}
OUTPUT:
Convert decimal number to binary number example
Binary value of 56 is 111000
Convert decimal number to binary number example
Binary value of 56 is 111000
Comments
Post a Comment