Program to Find Out Circumference and Area of a Circle in Python


import math
radius = float(input('Enter radius of the circle:')
circum = 2 * math.pi * radius
area = math.pi * radius * radius
print('Circumference of the circle is: ', circum)
print('Area of the circle is: ', area)

Explanation of code line by line.


This line includes math library in the program.
This line is used to take value of radius of circle from user using input() function.
Circumference is calculated and referred by variable circum.
Area is calculated and referred by area area.
Value of circumference is printed.
Value of area is printed.

Leave a Comment

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

©Postnetwork-All rights reserved.