Selasa, 15 November 2011

HeksadecimalToDecimal

import java.io.*;
import java.lang.*;

public class  HexadecimalToDecimal{
  public static void main(String[] args) throws IOException{
  try {
  BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
  System.out.println("Enter the Hexadecimal number:");
  String str= bf.readLine();
  int i= Integer.parseInt(str,16);
  System.out.println("Decimal:="+ i);
  }catch (IOException e) {throw e;
        } catch(Exception e) {
            throw new RuntimeException("Inputan Anda Bukan Bilangan Heksa Maupun Desimal" +
                    e.toString());
}
}
}

0 komentar:

Posting Komentar