Q:

Java program to Calculate Perimeter of a Circle

0

Java program to Calculate Perimeter of a Circle

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Perimeter of Circle using Java Program

//Java program to Calculate Perimeter of a Circle.

import java.util.Scanner;

public class PerimeterCircle {

  public static void main(String[] args) {

    double radius;
    Scanner sc = new Scanner(System.in);

    // input radius of circle
    System.out.print("Enter the Radius of Circle : ");
    radius = sc.nextDouble();

    // circle parameter is 2 * pie * radius 
    double Perimeter = 2 * 3.14 * radius;

    System.out.print("Perimeter of Circle : " + Perimeter);

  }

}

Output:

    
    Enter the Radius of Circle : 3.5
    Perimeter of Circle : 21.98

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Core Java Example programs for Beginners and Professionals

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
EMI Calculator in Java - Java program to calculate... >>
<< Java program to Calculate Area of a Circle...