Advertisement
FaisalAhemdBijoy

arithmetic operation

Sep 16th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. echo Arithmetic operation
  2. num1=10
  3. num2=15
  4.  
  5. echo one way
  6. echo $num+$num2
  7. echo $num1*$num2
  8. echo $num1/$num2
  9. echo $num1-$num2
  10.  
  11. echo another way
  12. echo $((num1*num2))
  13. echo $((num1+num2))
  14. echo $((num1-num2))
  15. echo $((num1/num2))
  16.  
  17. echo another way
  18. echo $(expr $num1 + $num2 )
  19. echo $(expr $num1 - $num2 )
  20. echo $(expr $num1 * $num2 )
  21. echo $(expr $num1 / $num2 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement