1public class DecimalToBinaryUsingRecursion
2{
3 public static void main(String[] args)
4 {
5 int inputDecimal = 50;
6 System.out.println(toBinary(inputDecimal));
7 }
8 static int toBinary(int decimal)
9 {
10 if(decimal == 0)
11 return 0;
12 else
13 return(decimal % 2 + 10 * toBinary(decimal / 2));
14 }
15}