Cari Blog Ini

Suka Blog Ini

Minggu, 20 November 2011

Tugas Program/Bahasa Java mengenai SubString



-------------------------------------------------------------------------
public class tugassub
{
    public static void main(String[] args)
    {
        double A = 23.54;
        int B = 12;
        int C = 10;
        double x = ((A+B) / (A-C));
        String y = Double.toString(x);
       
        System.out.println("Hasil (A+B) / (A-C) = "+x);
        System.out.println("Hasil (A+B) / (A-C) = " + y.substring(0,7));



    }
}

-------------------------------------------------------------------------
Save dengan =

Files Name : tugassub.java
Save as type : All Files