This example we are print an array values arr= Array["Java","Kotlin","Flutter","Reactnative"] #printing single element puts arr[0] #printing all the elements in a single row print arr #printing one by one using for loop for i in arr puts i end #printing one by one without loop puts arr Output
Java
["Java", "Kotlin", "Flutter", "Reactnative"]
Java
Kotlin
Flutter
Reactnative
Java
Kotlin
Flutter
Reactnative
What's the difference between a lambda, a block and a proc?
Ruby program to print an array
How to Replace array elements in Ruby?
What are some of your favorite gems? What are their alternatives?
Ruby program to check whether the given number is Armstrong
How to Get Input with Gets in Ruby
Ruby program to add two integer numbers
How to Sort Array in Ruby?
Ruby program to check whether the given number is prime or not
Ruby program to Calculate the factorial of given number
Creating Array with Array.new(size, obj) in Ruby
Ruby program to check whether the given number is palindrome
What are the various Ruby runtimes, and how are they different?
Program to Print Triangle of Numbers in Ruby
How to get index of array element in Ruby
How to add/remove elements to Array in Ruby?
Ruby program to print Fibonacci series
How to create two dimensional array in ruby?
Ruby program to generate random numbers
What are #method_missing and #send? Why are they useful?
how to create an array with Array.[](*args) in Ruby ?
How to shuffle an array in Ruby?
Ruby program to reverse a string