Advertisement
arafaee

Lingkaran.java

Apr 18th, 2017
16,737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1.  
  2. /**
  3.  * Lingkaran.java
  4.  *
  5.  * @author Hafara Firdausi/ 5115100043
  6.  * @version 01
  7.  */
  8.  
  9. import java.util.Scanner;
  10.  
  11. public class Lingkaran
  12. {
  13.    public static void main(String[] args)
  14.    {
  15.        double phi=3.14, r, luas, keliling;
  16.        Scanner I = new Scanner (System.in);
  17.        
  18.        System.out.print("Masukkan jari-jari lingkarannya : ");
  19.        r=I.nextInt();
  20.        
  21.        luas=phi*r*r;
  22.        System.out.println("Luas lingkaran adalah : "+luas);
  23.        
  24.        keliling=2*phi*r;
  25.        System.out.println("Keliling lingkaran adalah : "+keliling);
  26.    }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement