Venciity

[SoftUni Java] Syntax - 05.DecimalToHexadecimal

May 12th, 2014
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 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 input = new Scanner(System.in);
  8.         int number = input.nextInt();
  9.         input.close();
  10.         System.out.println(Integer.toHexString(number).toUpperCase());
  11.     }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment