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