Guest User

Untitled

a guest
Feb 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.16 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. num=0          
  4. sum=0
  5. while [ $num -le $1 ]  
  6.    do
  7.         sum=$(($sum+$num))
  8.         num=$(($num+1))
  9. done
  10. echo -e "Sum from 1 to $1: $sum
Add Comment
Please, Sign In to add comment