Friday, 3 May 2019

Display the * values in triangle shape in ruby

for i in 1..10
  for j in 1..i
    print ('*')
  end
  print ("\n")
end


output:
*
**
***
****
*****
******
*******
********
*********
**********

No comments:

Post a Comment

Interactor in Rails

What is interactor? Interactor provides a common interface for performing complex user interactions An interactor is a simple, sin...