Ruby program to calculate the perimeter of the circle

bookmark

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

perimeter = 2* 3.14 * radius;

print "Perimeter of circle: ",perimeter;

 


Output:

Enter radius: 6
Perimeter of circle: 37.68