Ruby program to calculate the area of Parallelogram

bookmark

base=0.0;
altitude=0.0;
area=0.0;

print "Enter base: ";
base = gets.chomp.to_f;  

print "Enter altitude: ";
altitude = gets.chomp.to_f;  

area = base * altitude;

print "Area of Parallelogram is: ",area;

 


Output:

Enter base: 3.13
Enter altitude: 4.6
Area of Parallelogram is: 14.397999999999998