# Program to find the circumference of circle
"""
In this program, we have to calculate the circumference of circle
We have the formula,
v=2*pie*r
As we already know the value of pie as 22/7 or 3.1415,
we only have to ask the value of r from the user
"""
r = float(input('enter the radius of circle'));
v=2*22/7*r
print("The circumference of circle is", v)
"""
If the radius is explicitly given.
Then we do not have to ask the value of r from the user
Let us suppose we have to find the volume of sphere whose radious is r."""
r = 3.2
v=2*22/7*r
print("The circumference of circle is", v)
"""
We can also do this question by defining value of pie
instead of giving value of pie as 22/7 or 3.1415.
"""
pie=22/7
r = float(input('enter the radius of sphere'));
v=2*pie*r
print("The circumference of circle is", v)
"""
We can also do this by using constants.
For that we must define the constants in next module or in seperate file.
Normally in practice, constants are rarely used in Python.
"""
6. Write a program in python to display circumference of circle.
Related Posts
31. Write a program to display total surface area and volume of cube.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)
Algorithm: Step 1: Start Step 2: Input Length. (L) Step 3: A = 6 * L ^ 2…
33. Write a program to display volume of cube.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)
Algorithm: Step 1: Start Step 2: Input Length. (L) Step 3: V = L ^ 3 Step 4:…