Circumference of circle
previous NextExample
import java.util.Scanner;
class Circumference
{
public static void main(String[] args) {
int radius;
float cir;
Scanner sc = new Scanner(System.in);
System.out.print("Enter Radius of the Circle: ");
radius = sc.nextInt();
cir = (float)(2 * 3.14 * radius);
System.out.println("Circumference of the Circle: "+cir);
}
}
Output :
Enter radius of the circle: 6 Circumference of the circle: 37.68