This simple program will ask the user to give a number and then our program will convert the given number by the user into hexadecimal equivalent. The program is very easy to understand and use.
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
package hello;
import java.util.Scanner;
public class Decimal_Hexadecimal {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
int values = 0;
System.out.println("Decimal To Hexadecimal Converter in Java");
System.out.println();
System.out.print("Enter a Number : ");
values = input.nextInt();
String hex_value = Integer.toHexString(values);
System.out.println("The Hexadecimal Value is : " + hex_value + ".");
System.out.println();
System.out.println("\t End of Program");
}
}
No comments:
Post a Comment