Write a shell program to test whether a given number is even
or odd?
Answer Posted / mani
echo "Enter the Number"
read a
b=`echo "$a % 2"|bc`
if [ $b -eq 0 ]
then
echo "Given Number is Even "
exit
fi
echo " Given Number is odd"
| Is This Answer Correct ? | 67 Yes | 34 No |
Post New Answer View All Answers
What is a batch file used for?
Is shell scripting a language?
How can I send a mail with a compressed file as an attachment?
What are the different variables present in linux shell?
What are the advantages of shell scripting?
Explain about "s" permission bit in a file?
write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?
How do I stop script errors?
How to set an array in linux?
What is the lifespan of a variable inside a shell script?
Is bash a shell script?
What are zombie processes?
What is option in shell script?
Explain about echo command?
What is the default shell of solaris?