📅  最后修改于: 2022-03-11 14:51:20.908000             🧑  作者: Mango
#shell script to find sum of n numbers using for loop
echo "Enter Size(N)"
read N
sum=0
echo "Enter Numbers"
for((i=1;i<=N;i++))
do
read num #get number
sum=$((sum + num)) #sum+=num
done
echo $sum