Thursday, May 1, 2008

Any integer is input from the keyboard. Write a program to find out whether it is an odd number or even number.

# SS8

# Script to determine whether a given number is odd or even

# Usage: SS8

clear

echo Enter any number

read num

if [ ‘expr $num %2‘ -eq0 ]

then

echo number is eve

else

echo number is odd

fi

No comments: