Write a shell program to test whether a given number is even
or odd?
Answer Posted / padmas
echo -n "Please give any odd number : "
read n
rem=$(( $n % 2 ))
if [ $rem -eq 0 ]
then
echo "Thank you for giving even number."
else
echo "Yes, it is odd"
fi
| Is This Answer Correct ? | 9 Yes | 12 No |
Post New Answer View All Answers
What are the four fundamental components of every file system on linux?
How does shell scripting work?
Explain about stdin, stdout and stderr?
Why is it called a shell?
What is scripting used for?
What exactly is a shell?
Why do we write bin bash in shell scripts?
What is echo $shell?
What is a program shell?
What does $@ mean bash?
is this growing field and what is average package in this?
What makes c shell a more preferable option than the bourne shell?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
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 save a powershell script?