VIISeptem

Untitled

Feb 6th, 2020
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. public class Binär
  2. {
  3.  
  4.     public String toBinäry(int n)
  5.     {
  6.         String output = "";
  7.         int wert = 1024;
  8.         int z;
  9.         while(n > 0){
  10.             if(n % 2 == 0){
  11.                
  12.                
  13.                 output = output + "0";
  14.  
  15.             }else{
  16.                 output = output + "1";
  17.             }
  18.            n = n / 2;
  19.         }
  20.         return output;
  21.     }
  22.  
  23. }
Add Comment
Please, Sign In to add comment