Advertisement
joaopaulofcc

Untitled

Jul 9th, 2021
1,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.27 KB | None | 0 0
  1. read num1
  2. read num2
  3. read op
  4.  
  5. if [ $op -eq 1 ]
  6. then
  7.   soma=$(($num1 + $num2 ))
  8.   echo "A soma dos dois números é: $soma"
  9. elif [ $op -eq 2 ]
  10. then
  11.   sub=$(($num1 - $num2 ))
  12.   echo "A subtração dos dois números é: $sub"
  13. else
  14.   echo "Operação inválida!"
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement