Bijan Krishna Paul
VILL- DEBANDI, AMTA, HOWRAH PIN-711410 Phone-9836357266
Tuesday, January 24, 2023
Unix Shell Programming Example for B.Sc, B.Tech, BCA, MCA
1.
Use of while loop.
PROGRAM:
echo "enter no. of elements:"
read n
a=0
while [ $a -ne $n ]
do
echo $a
((a++))
done
OUTPUT:
[bgc@localhost ~]$ sh pc1.sh
enter no. of elements:
3
0
1
2
[bgc@localhost ~]$
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment