The conversion of decimal to binary…. Yeah, we all know about it. Its just division and reminder.. and repeat..
But how we efficiently do that… And we have limitation.. Of-course we have..
Even computers have..
A 64 bit binary in Decimal is around 10 to the power 19… yeah very large enough… Now we convert Decimal to Binary.. lets check the limitation…
Screenshot / Output
public class binary
public static void main(String arg)
System.out.print("Give the decimal Number: ");
Scanner s = new Scanner(System.in);
long n = s.nextLong();
long a = new long;
for(i = 0; i<64; i++)
a[63-i] = (n%2);
for(k=0; k<64; k++)
System.out.println("Number of bit" +(64-k));
for(int l=k; l>=k&&l<64; l++)
for(j=0; j<64; j++)
Latest posts by Bikash Panda (see all)
- OSMC on Raspberry PI with Setup and Control using Android App - July 7, 2017
- DHT12 Interfacing with Raspberry Pi using Pi4J - June 19, 2017
- Send data using MQTT from Raspberry Pi with JAVA - June 12, 2017