Write programs which uses associative arrays concept of Ruby.
hash.rb
student = Hash["rollno"=>501,"name"=>"RISE Gandhi","Address"=>"Valluru"]
student.each do |key,value|
print(key,"\t:\t",value,"\n")
end
OUTPUT
rollno : 501
name : RISE Gandhi
Address : Valluru
hash.rb
student = Hash["rollno"=>501,"name"=>"RISE Gandhi","Address"=>"Valluru"]
student.each do |key,value|
print(key,"\t:\t",value,"\n")
end
OUTPUT
rollno : 501
name : RISE Gandhi
Address : Valluru