Denyutama.blogspot.com


mohon bantuanya untuk di like,terimakasih

Saturday, April 13, 2013

bilangan baku di java


/* Program Bilangan Baku
 * author : Deni Utama
 * versi  : 31 Maret 2013
 */
import java.util.Scanner;
public class BilanganBaku{
    public static void main(String[]args){
        Scanner show = new Scanner(System.in);
        System.out.print("Masukkan bilangan n : ");
        String a = show.next();
        double n = Double.parseDouble(a);
        System.out.print("Berapa digit bilangan tersebut dibakukan : ");
        int d = show.nextInt();
        double q = n/(Math.pow(10,((a.length()+1)-d)));
        int c = a.length()+1-d;
        System.out.println(q+" x 10^"+c);
    }
}

No comments:

Post a Comment