Skip to content

Instantly share code, notes, and snippets.

View kmbenjel's full-sized avatar

Khalid Benjelloun kmbenjel

View GitHub Profile
@kmbenjel
kmbenjel / until_zero.rb
Created April 18, 2021 07:23
This program keeps accepting numbers from the user till he submits the number 0, then it prints out the sum of the numbers, the max, the min and the average and ends.
min = 0
max = 0
sum = 0
count = 0
input = ""
def results(min,max,avg)
puts "End of program"
puts "-------------------------"
puts "The lowest number was: #{min}"
puts "The highest number was: #{max}"