Thursday, May 1, 2008

Write a shell script to print even numbers upto ‘n’.

echo “Enter Upper limit”

read n

$i = 2

while [$i -lt $n]

do

echo $i

expr ‘$i=$i+2’

done

No comments: