IRusev

Problem 5. Decimal to Hexadecimal

Sep 9th, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class DecimalHexadecimal {
  5.  
  6. public static void main(String[] args) {
  7.  
  8. Scanner input = new Scanner(System.in);
  9. int number = input.nextInt();
  10. System.out.printf("%1$X", number);
  11. input.close();
  12. }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment