rumus: 3,14 * (jari-jari)
Program java :
import javax.swing.JOptionPane;
public class luaslingkaran
{
public static void main(String args[])
{
String first;int number1;int sum;
first=JOptionPane.showInputDialog("Masukkan jari-jari lingkaran");
number1=Integer.parseInt(first);
sum=22/7*number1*number1;
JOptionPane.showMessageDialog(null,"Luas lingkaran adalah: "+sum,"Hasil",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
Program java :
import javax.swing.JOptionPane;
public class luaslingkaran
{
public static void main(String args[])
{
String first;int number1;int sum;
first=JOptionPane.showInputDialog("Masukkan jari-jari lingkaran");
number1=Integer.parseInt(first);
sum=22/7*number1*number1;
JOptionPane.showMessageDialog(null,"Luas lingkaran adalah: "+sum,"Hasil",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
}
0Awesome Comments!