Write a Ruby program to test whether you are minor (Consider a child unless he or she is less than 18 years old.) or not.
Ruby Code:
print "Input your age: " age = gets.to_i puts "You are a minor" unless age >= 18
Output:
Input your age: You are a minor.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Ruby Code:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer