SHARE
TWEET

Untitled

linuxyamigos Jan 14th, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #!/bin/bash
  3. echo -n "introduzca el primer numero "
  4. read num1
  5.  
  6. echo -n "introduzca el segundo numero "
  7. read num2
  8.  
  9. d1=$(expr $num1 - $num2)
  10. d2=$(expr $num2 - $num1)
  11.  
  12. v1=$num1
  13. v2=$num2
  14.  
  15. primos=(1 2 3 5 7)
  16.  
  17. for ((i=0; i<${#primos[@]}; i++)); do
  18.     if [[ $d1 -eq ${primos[i]} ]] || [[ $d2 -eq ${primos[i]} ]]; then
  19.         res2=$(($num1 * $num2))
  20.         echo "El producto de los numeros es: $res2 "
  21.         break
  22.     fi
  23. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top