Advertisement
Guest User

Untitled

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