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…😀

import java.io.*;

public class LuasSegitiga
{
public static void main(String[] args) throws Exception
{ BufferedReader input=new BufferedReader (new InputStreamReader(System.in));
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:

WordPress.com Logo

You are commenting using your WordPress.com 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