Josif_tepe

Untitled

Jan 21st, 2026
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. echo "Enter a number:"
  3. read N
  4.  
  5. sum=0
  6.  
  7. for (( i=1; i<=N; i++ ))
  8.     do
  9.         sum=$((sum + i))
  10. done
  11.  
  12. echo "The sum from 1 to $N is: $sum"
Advertisement
Add Comment
Please, Sign In to add comment