Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # mcd
  4.  
  5. echo –n ‘Introduce a: ’
  6.  
  7. read a
  8.  
  9. echo –n ‘Introduce b: ’
  10.  
  11. read b
  12.  
  13. while test ! $a -eq $b
  14.  
  15. do
  16.  
  17. if test $a -gt $b
  18.  
  19. then
  20.  
  21. a=`expr $a - $b`
  22.  
  23. else
  24.  
  25. b=`expr $b - $a`
  26.  
  27. fi
  28.  
  29. done
  30.  
  31. echo “El MCD es $a”
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement