Jumat, 30 Desember 2011

tugas algoritma modul 4

import java.util.Scanner;

public class Lingkaran

{
public static void main(String args[])

{
Scanner masuk = new Scanner(System.in);

float phi = 3.14f;
int r;

float keliling, luas;

System.out.println("Jari - jari Lingkaran: ");

r = masuk.nextInt();
keliling = 2 * phi * r;

luas = phi * r * r;
System.out.println("Keliling Lingkaran: " + keliling);

System.out.println("Luas Lingkaran: " + luas);
}
}

0 komentar:

Posting Komentar

Statistik

Translate

Blog Archive