Advertisement
IvanKrastev

Homework Java Syntax Problem 5 Decimal to Hexademical

Jan 26th, 2015
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class Problem_5_DecimalToHexademical {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner scan= new Scanner(System.in);
  8.         System.out.print("Add positive integer: ");
  9.         int intNumber= scan.nextInt();
  10.         String result= Integer.toHexString(intNumber);
  11.         result = result.toUpperCase();
  12.         System.out.println(result);
  13.        
  14.  
  15.     }
  16.    
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement