Friday, 12 December 2014

Shell Script for Counting upto required number

Write a Shell Script for Counting upto required number

Solution:
echo Enter any number
read a
echo Counting Starts
n=1
while [ $n -le $a ]
do
echo $n
n=`expr $n + 1`
done

Execution:


No comments:

Post a Comment