Question - Take diameter as input and calculate the area of a circle.
diameter = int(input("Enter the value of diameter: "))
radius = diameter/2
area = 3.14 * (radius ** 2)
print("Radius of the circle is", radius)
print("Area of circle is", area)
The Code can be written like this:
Diameter = float(input("Enter the value of diameter: "))
Area = Diameter * 3.14
print ('Area: ' , Area)
Question - Take diameter as input and calculate the area of a circle.
diameter = int(input("Enter the value of diameter: "))
radius = diameter/2
area = 3.14 * (radius ** 2)
print("Radius of the circle is", radius)
print("Area of circle is", area)
The Code can be written like this:
Diameter = float(input("Enter the value of diameter: "))
Area = Diameter * 3.14
print ('Area: ' , Area)