/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package binner_oktal_hexa_kedesimal;
import java.util.Scanner;
/**
*
* @author Planet Setup
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("KONVERSI BINNER, OKTAL, HEXADESIMAL KE DESIMAL");
System.out.println("----------------------------------------------");
System.out.println("");
System.out.print(" Inputkan Nilai Binner : ");
String binner = input.next();
System.out.print(" Inputkan Nilai Oktal : ");
String oktal = input.next();
System.out.print(" Inputkan Nilai Hexa : ");
String hexa = input.next();
int desbinner = Integer.parseInt(binner,2);
int desoktal = Integer.parseInt(oktal,8);
int deshexa = Integer.parseInt(hexa,16);
System.out.println(" ");
System.out.println("KONVERSI ");
System.out.println("-------- ");
System.out.println("Binner : " + binner + " desimal : " + desbinner );
System.out.println("Oktal : " + oktal + " desimal : " + desoktal );
System.out.println("Hexadesimal : " + hexa + " desimal : " + deshexa );
// TODO code application logic here
}
}
semoga bermanfaat.................
selamat mencoba
Komentar
Posting Komentar