Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,167 questions

40,724 answers

573 users

How to reverse an array in Ruby

1 Answer

0 votes
arr = [4, 7, 1, 9, 6]

puts arr.join(" ")

arr = arr.reverse
puts arr.join(" ")





# run:
# 
# 4 7 1 9 6
# 6 9 1 7 4
#

 





answered Dec 24, 2020 by avibootz

Related questions

1 answer 63 views
63 views asked Nov 7, 2020 by avibootz
2 answers 81 views
81 views asked Nov 7, 2020 by avibootz
1 answer 82 views
1 answer 72 views
1 answer 45 views
...