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

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.