Advertisement
n_stefanov

Ex5_DecimalToHexadecimal

May 11th, 2014
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. package javaSyntax;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Ex5_DecimalToHexadecimal {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner in = new Scanner(System.in);
  9.        
  10.         int number = in.nextInt();
  11.         System.out.println(Integer.toHexString(number).toUpperCase());
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement