Decimal number to Binary by recursion
import java.util.Scanner; class Binary { public static void binary(int number) { if(number > 1) { binary( number/2 ); } System.out.print( number % 2 ); } public static void main(String[] args) { System.out.println("Enter The Number : "); Scanner sc = new Scanner(System.in); int number = sc.nextInt(); binary(number); } }