membuat Luas Segitiga pada java

Posted on

di bawah ini adalah coding luas segitiga pada java. jangan lupa memberi nama file.a dgan “LuasSegitiga” ya… 😀


public class LuasSegitiga
public static void main(String[] args) throws Exception
{ BufferedReader input=new BufferedReader (new InputStreamReader(;
System.out.println(“masukkan niali alas:”);
int alas= Integer.parseInt(input.readLine());
System.out.println(“masukkan nilai tinggi:”);
int tinggi= Integer.parseInt(input.readLine());
System.out.println(“hasil luas segitiga adalah:” +(alas*tinggi/2));


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s