Adsense Ad

Monday 27 May 2019

Write a Python program which accepts the radius of a circle from the user and compute the area.


Python: Area of a Circle
In geometry, the area enclosed by a circle of radius r is πr2. Here the Greek letter π represents a constant, approximately equal to 3.14159, which is equal to the ratio of the circumference of any circle to its diameter.
Sample Solution:-
Python Code:
import math
radius = float(input("Input the radius of the circle: "))
area = math.pi * radius ** 2
print("The area of the circle with radius "+str(radius)+" is: "+str(area))

Sample Output:
Input the radius of the circle: 1.1 
The area of the circle with radius 1.1 is: 3.8013271108436504


Flowchart:

No comments: