Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
Reverse a String
polymorphic mapper
assignment 3
Hi
classwork
Copy an array elments into another array
1.5
rd dap da
Alumnos Java con Input
Sample for https://stackoverflow.com/a/49984959/4216641
Please log in to post a comment.