Edad mayor o menor


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



Copy this code and paste it in your HTML
  1. puts " Introduce tu edad"
  2.  
  3. def mayorDeEdad(anios)
  4. if anios >= 18
  5. puts "Eres una gaviota"
  6. else
  7. puts "Eres un pezqueñin "
  8. end
  9.  
  10. end
  11. mayorDeEdad(Edad=gets.chomp.to_i)

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.