Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
public class Bin {
private static java.util.Scanner scanner;
public static void main(String[] args) {
long a;
int count = 0;
scanner = new java.util.Scanner (System.in);
System.out.print("Eingabe der Dezimalzahl : ");
a = scanner.nextLong();
String bin = "";
while (a > 0) {
if (a % 2 == 0)
bin = bin + "0";
else
bin = bin + "1";
a /= 2;
}
for(count = bin.length(); count < 32; count++){
bin = 0 +bin;
}
System.out.println(bin);
}
}
public class Bin {
private static java.util.Scanner scanner;
public static void main(String[] args) {
long a;
int count = 0;
scanner = new java.util.Scanner(System.in);
System.out.print("Eingabe der Dezimalzahl : ");
a = scanner.nextLong();
String bin = "";
while (a > 0) {
if (a % 2 == 0)
bin = "0" + bin;
else
bin = "1" + bin;
a /= 2;
}
for (count = bin.length(); count < 32; count++) {
bin = 0 + bin;
}
for (int i = 0; i < bin.length(); i++) {
System.out.print(bin.charAt(i));
if ((i + 1) % 8 == 0) {
System.out.print("\t");
}
}
}
}
if ((i + 1) % 8 == 0) {
System.out.print("\t");