codemaniacstudio

Write a Python program to enter radius of a circle and find its diameter, circumference and area.

Write a Python program to enter radius of a circle and find its diameter, circumference and area.

SOLUTION....

# Program to calculate diameter, circumference and area of a circle

import math   # for using pi

# Input
radius = float(input("Enter the radius of the circle: "))

# Calculations
diameter = 2 * radius
circumference = 2 * math.pi * radius
area = math.pi * radius * radius

# Output
print("Diameter of Circle = ",diameter)
print("Circumference of Circle =",circumference)
print("Area of Circle =", area)

OUTPUT

Exit mobile version