Jumat, 30 Desember 2011

tugas algoritma modul 6

import java.util.Scanner;

public class Modul5

{
public static void main(String args[])

{
Scanner masuk = new Scanner(System.in);

float D,a,b,c;

System.out.print("masukkan a:");

a = masuk.nextFloat();

System.out.print("masukkan b:");
b = masuk.nextFloat();
System.out.print("masukkan c:");
c = masuk.nextFloat();

D = b*b-(4*a*c);
if (D==0)



System.out.println("akar kembar");

else if (D>0)

System.out.println("akar berbeda");
else


System.out.println("akar imajier");
}
}

0 komentar:

Posting Komentar

Statistik

Translate

Blog Archive