Ruby program to find the cosine of given radian value
print "Enter value in radian: ";
radian = gets.chomp.to_f;
result = Math.cos(radian);
print "Cosine is: ",result;
Output:
Enter value in radian: 12.34
Cosine is: 0.9744873987650982
