answersLogoWhite

0

echo -n "Enter the radius of a circle : "

read r

# use formula to get it

area=$(echo "scale=2;3.14 * ($r * $r)" | bc)

# use formula to get it

d=$(echo "scale=2;2 * $r"|bc)

circumference=$(echo "scale=2;3.14 * $d"| bc)

echo "Area of circle is $area"

echo "Circumference of circle is $circumference"

# ### softspy88@gmail.com

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

BeauBeau
You're doing better than you think!
Chat with Beau
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine

Add your answer:

Earn +20 pts
Q: Write a shell program to find the area and circumference of the circle?
Write your answer...
Submit
Still have questions?
magnify glass
imp