Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Problem: binary
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void binary(int num) { int num1 = num; String binary = ""; int rem = 0; while (num > 0) { rem = num % 2; binary = rem + binary; num = num/2; } System.out.println("Binary Conversion of "+num1+" is "+binary); } public static void main(String[] args) { int num = 6; //input here binary(num); } }
run
|
edit
|
history
|
help
0
Table for 20
1d
mostrar pam
jb11.0 threads tick tock 1.0
epeenconverter
prime numbers
preincrement1
LunarLanding.java
1a
2D List Iterator