0
Q:

tobinarystring

// Java program to demonstrate 
// java.lang.Integer.toBinaryString() method 
import java.lang.Math; 
  
class Gfg1 { 
  
    // driver code 
    public static void main(String args[]) 
    { 
  
        int l = 10; 
        // returns the string representation of the unsigned int value 
        // represented by the argument in binary (base 2) 
        System.out.println("Binary is " + Integer.toBinaryString(l)); 
  
        l = 9; 
        System.out.println("Binary is " + Integer.toBinaryString(l)); 
    } 
} 
1

New to Communities?

Join the community