Advertisement
Guest User

DecimalToHexadecimal

a guest
May 12th, 2014
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class DecimalToHexadecimal {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner sc = new Scanner(System.in);
  8.         System.out.println("Enter a positive integer: ");
  9.         String value = Integer.toHexString(sc.nextInt()).toUpperCase();
  10.         System.out.println(value);
  11.  
  12.     }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement