How to control de age in yout programs

/ Published in: Ruby
Save to your folder(s)

A program fronm controlate your programs with dea age

Copy this code and paste it in your HTML
  1. def mayorDeEdad(anios)
  2. if anios >= 18
  3. puts "Gandeee!!"
  4. else
  5. puts "Enanin!!"
  6. end
  7. end
  8. puts "Cuantos años tienes?"
  9. anios = gets.chomp.to_i
  10. mayorDeEdad(anios)

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.