Ruby Program to Calculate the Perimeter of the Circle

You are currently viewing 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

Ranjith Kumar

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

Leave a Reply