Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Homework2;
- import java.util.*;
- public class DecimalToHex {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int n = scan.nextInt();
- String hex = Integer.toHexString(n);
- System.out.println(n + " in hexidecimal is " + hex.toUpperCase());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement