Computer Science, asked by mahiKatiyar, 3 months ago

Write a program to calculate and print the circumference and area of a

circle in Python​

Answers

Answered by Anonymous
14

Answer:

hello,

Explanation:

# program to calculate and print the circumference and area of a  circle

r=float(input("enter the radius"))

area=(3.14)*r*r

circum=(2)*(3.14)*r

print("area of the circle is:",area)

print("circumference of the circle is:",circum)

__________________

hope it helps you

please mark brainliest

@ItzSnowySecret07

Answered by anindyaadhikari13
20

Required Answer:-

Question:

  • Write a program to calculate and print the perimeter and area of a circle in Python.

Solution:

Sample program in Python.

import math

r=float(input("Enter radius: "))

c=2*math.pi*r

a=math.pi*r*r

print("Circumference: ",c)

print("Area: ",a)

Explanation:

  • Area and circumference is given by the formula - A = πr² and P = 2πr. To use the value of π, we have to import the math module. From that, we can use the value of pi. math.pi contains the value of pi. In this way, we can calculate the area and circumference of the circle.

Output is attached.

Attachments:
Similar questions