Java Program to Find the Perimeter of a Circle, Rectangle and Triangle

In this program, you will learn to Find the Perimeter of a Circle, Rectangle and Triangle in Java.

Formula:

Perimeter of circle = 2*pi*r
Perimeter of rectangle = 2*(l+b)
Perimeter of triangle = (s1+s2+s3)

Enter the radius of the circle, length and breadth of the rectangle and three sides of the triangle as inputs. Calculate the perimeter by using formula and get the desired output.

Find the Perimeter of a Circle, Rectangle and Triangle


When you run the program, the output will be:

Enter Radius of Circle : 7
Perimeter of Circle is 42.0
Enter Length of Rectangle : 12
Enter Breadth of Rectangle : 8
Perimeter of Rectangle is 40.0
Enter Length of First Side of Triangle : 25
Enter Length of Second Side of Triangle : 6
Enter Length of Third Side of Triangle : 8
Perimeter of Triangle is 39.0

Post a Comment

Thank you for vising

أحدث أقدم