Pages

Sunday, 25 December 2016

Problem 81 - Hexadecimal suatu angka


Program akan memanfaatkan fungsi Integer.toHexString(num).
Source code program adalah
DATA HOSTED WITH ♥ BY PASTEBIN.COM - DOWNLOAD RAW - SEE ORIGINAL
  1. import java.util.Scanner;
  2. class Hexa
  3. {
  4.     public static void main(String args[])
  5.     {
  6.       Scanner input = new Scanner( System.in );
  7.       System.out.print("Angka : ");
  8.       int num =input.nextInt();
  9.       String str = Integer.toHexString(num);
  10.       System.out.println("Hexadecimal: "+str);
  11.     }
  12. }
Hasil output program adalah

0 comments:

Post a Comment