ADVERTISEMENT
ADVERTISEMENT

Java program to Calculate Perimeter of a Circle

Find Perimeter of Circle in Java - This program will read radius from the user and calculate the Perimeter of the circle.

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

Core Java Example Programs »


ADVERTISEMENT




ADVERTISEMENT


Comments and Discussions!

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.