Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "Ingrese un numero"
- read "a"
- echo "Ingrese otro numero"
- read "b"
- echo " Ingrese operacion,1-multiplicar,2-sumar,3-restar,4-comparar"
- read "operacion"
- case $operacion in
- 1)
- multiplicacion ;;
- 2)
- suma ;;
- 3)
- resta ;;
- 4)
- mayor ;;
- esac
- function multiplicacion(){
- let C=$a\*$b
- echo "la multiplicacion es : $C"
- }
- function suma(){
- let C=$a+$b
- echo "la suma es : $C"
- }
- function resta(){
- let C=$a-$b
- return "la resta es: $C"
- }
- function mayor(){
- if [ $a -gt $b ]; then
- echo "$a es mayor a $b"
- else
- echo "$a no es mayor a $b"
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement