
can i get the code for converting decimal to hexadecimal

Here is a code that converts decimal to hexadecimal.
import java.io.*;
public class DecimalToHexadecimal{
public static void main(String[] args) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the decimal value:");
String hex = bf.readLine();
int i = Integer.parseInt(hex);
String hex1 = Integer.toHexString(i);
System.out.println("Hexa decimal: " + hex1);
}
}
Here is a code that converts hexadecimal to decimal.
import java.io.*;
public class HexadecimalToDecimal{
public static void main(String[] args) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the Hexadecimal number:");
String str= bf.readLine();
int i= Integer.parseInt(str,16);
System.out.println("Decimal:="+ i);
}
}

thank yoy sir.can i get the code without using standard libraries
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.