simple-exercises/ruby-exercises/very-easy.rb
# Write a method that takes in an integer `num` and returns the sum of
# all integers between zero and num, up to and including `num`.
Write a method that takes in an integer `num` and returns the sum of
all integers between zero and num, up to and including `num`.
Write a method that takes in an integer ` num ` and returns the sum of all integers between zero and num up to and including ` num ` .
def sum_nums num
  sum = 0
  (1..num).each do |i|
    sum += i
  end
  sum
end
def sum_nums num sum = 0 ( 1 .. num ) . each do | i | sum += i end sum end
Write a method that takes in an integer `num` and returns the sum of
all integers between zero and num, up to and including `num`.
Write a method that takes in an integer ` num ` and returns the sum of all integers between zero and num up to and including ` num ` .
num
<not_specific>