Jumat, 30 Desember 2011

program determinan

import java.util.Scanner;
public class Determinan
{
public static void main(String args[])
{
Scanner z = new Scanner(System.in);
int a,b,c,d;
System.out.print("Masukkan Nilai Pertama : ");
a = z.nextInt();
System.out.print("Masukkan Nilai Kedua : ");
b = z.nextInt();
System.out.print("Masukkan Nilai Ketiga : ");
c = z.nextInt();

d = b*b-(4*a*c);
System.out.println("Hasil : "+d);
System.out.println();
if (d==0)
{

System.out.println("Akar Kembar");
}
else if (d<0)
{

System.out.println("Akar Beda");
}
else if (d>0)
{

System.out.println("Akar Imajiner");
}
}
}

0 komentar:

Posting Komentar

Statistik

Translate

Blog Archive