Advertisement
obernardovieira

Power of 2 (binary values)

Mar 21st, 2015
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.13 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. res=1
  4. echo "Maximo:"
  5. read max
  6.  
  7. echo "-> 1"
  8. for x in $(seq 1 $max)
  9. do
  10.     res=$(($res*2))
  11.     echo "-> $res"
  12. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement