segitigaapa.java


public class segitigaapa
{
public static void main(String[] args)
{
int sisiA, sisiB, sisiC;
String namasegitiga;
double p, q;
sisiA = 5;
sisiB = 4;
sisiC = 3;
if ( sisiA > (sisiB + sisiC) )
{
namasegitiga = “Bukan Segitiga”;
} else
{
p = sisiA * sisiA;
q = sisiB * sisiB + sisiC * sisiC;
if ( p < q )
{
namasegitiga = “Segitiga Lancip”;
} else
{
if ( p == q )
{
namasegitiga = “Segitiga Siku-siku”;
} else
{
namasegitiga = “Segitiga Tumpul”;
}
}
}
System.out.println(namasegitiga);
}
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s