72) Write a program to input a number in Decimal and convert it Hexadecimal form? (100 in decimal then
64 in hexadecimal, divide by 16)
import java.util.*;public class Decimal_to_Hexadeciamal{public static void main(String args[ ]){Scanner sc = new Scanner (System.in);System.out.println("Enter a number");int b = sc.nextInt();int a = b;String c = "";while(a>=1){if(a%16<10&&a%16>-1){c=c+(a%16);}else if(a%16==10){c=c+"A";}else if(a%16==11){c=c+"B";}else if(a%16==12){c=c+"C";}else if(a%16==13){c=c+"D";}else if(a%16==14){c=c+"E";}else if(a%16==15){c=c+"F";}a=a/16;}int k = c.length();System.out.print("Entered number in HEXADECIMAL = ");for(int i = k-1;i>=0;i--){System.out.print(c.charAt(i));}}}