Could anyone tell me what's wrong with my program of iteration and method?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Could anyone tell me what's wrong with my program of iteration and method??

I want to make following 2 things. But they didn't work... I hope someone could teach me what's wrong. ○What I wanna make. 1. Method that can calculate Celsius from Fahrenheit. 2. Output of each calculation of method above when I put numbers from 1 to 100 in this method. ○My trial 1. Method def fahr_to_cels(fahr) cels = (fahr - 32) * 5 / 9 end 2. Output all_fahr = [1..100] all_fahr.each do |x| p fahr_to_cels(x) end thank you so much! Sorry for my poor English.

3rd Jan 2019, 6:57 AM
Yuta Shimizu
Yuta Shimizu - avatar
1 Answer
+ 1
Thank u so much!! I was confused with range and array 😅
3rd Jan 2019, 8:32 AM
Yuta Shimizu
Yuta Shimizu - avatar