Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. echo " ingrese un numero"
  2. read "a"
  3. echo "ingrese otro numero"
  4. read "b"
  5.  
  6.  
  7.  
  8.  
  9. function multiplicacion(){
  10. if [$# = 2 ]; then
  11.  echo "parametros enviados correctamente"
  12.    let C=$a\*$b
  13.   echo "la multiplicacion es : $C"
  14. }
  15.  
  16. function suma(){
  17.  let C=$a+$b
  18.  echo "la suma es : $C"
  19. }
  20.  
  21. function resta(){
  22.  let C=$a-$b
  23.  return $C
  24. }
  25.  
  26. function mayor(){
  27.  if [ $a -gt $b ]; then
  28.    echo "$a es mayor a $b"
  29.  else
  30.   echo "$a no es mayor a $b"
  31. fi
  32. }
  33.  
  34. mayor
  35. suma
  36. multiplicacion
  37. resta
  38.  
  39. echo $C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement