Ruby program to calculate the perimeter of the circle

Hello, friend today we are going to see clearly what we are going to see in the article Ruby program to calculate the perimeter of the circle. We hope you find this article very useful.

Ruby program to calculate the perimeter of the circle

Ruby program to calculate the perimeter of the circle

# Ruby program to calculate the 
# perimeter of the circle

print "Enter radius: ";
radius = gets.chomp.to_i;  

perimeter = 2* 3.14 * radius;

print "Perimeter of circle: ",perimeter;
Enter radius: 6
Perimeter of circle: 37.68

Final Words

Ruby program to calculate the perimeter of the circle We hope you find the article useful and will see you in the next article.

Hi, I'm Selva a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment