Write a shell program to print 50 to 40 using while loop.
Write Output as well.
Answers
Answered by
0
Program:
i=50
while [ $i -ge 40 ]
do
echo $i
i=$(($i-1))
done
Output:
50
49
48
47
46
45
44
43
42
41
40
Practice questions:
1) Print 1 to 50
2) Find sum of all digits of a number
3) Find factorial of a number
4) Find the largest and the smallest digit of a number
5) Find sum of all positive numbers up to N
Similar questions