geofox

Untitled

Mar 28th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.73 KB | None | 0 0
  1. nombre = 'Geovanny'
  2. puts ("Su nombre es  : "  + nombre ) * 1
  3.  
  4. puts "100 * 5 = #{100 * 5}"
  5. puts "Su nombre es : #{ nombre}"  #interpolacion
  6.  
  7. def dir_actual()
  8.     directorio = `dir`
  9.  
  10. end
  11.  
  12. puts  dir_actual()
  13.  
  14. def equipo()
  15.     puts  "Nombre del Equipo : " + `hostname`
  16. end
  17.  
  18.  
  19. equipo()
  20.  
  21. def di_adios(nombre)
  22.     resultado = "Buenas noches, #{nombre} "
  23. end
  24.  
  25.  
  26. puts  di_adios(nombre)
  27.  
  28.  
  29. nombre = 'Edgard'
  30.  
  31. def di_adios2(nombre)
  32.     resultado = 'Buenas noches, ' + nombre
  33. end
  34.  
  35.  
  36. puts di_adios2(nombre)
  37.  
  38.  
  39. def suma(num1,num2)
  40.     resultado = num1 + num2
  41.     total = resultado + 1
  42.     return resultado
  43. end
  44.  
  45. puts suma(10,2)
  46.  
  47. cadena = 'EDGARD GEOVANNY RODRIGUEZ ORELLANA'
  48.  
  49. def longitud(cadena)
  50.     cadena.length
  51. end
  52.  
  53. puts longitud(cadena)
Advertisement
Add Comment
Please, Sign In to add comment