Advertisement
Guest User

DecaToHexa

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