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
Give some situations where typing error can destroy a program?
Differentiate between ‘ and ” quotes.
What are the default permissions of a file when it is created?
How do I save a powershell script?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
What lives in a shell?
What are the various stages of a linux process it passes through?
How do we delete all blank lines in a file?
Can we run shell script in windows?
What is the difference between grep and egrep?
What does the sh command do?
What is difference between bash and shell?
Is shell scripting a programming language?
What is a shell script? Can you name some of its advantages?
How can I set the default rwx permission to all users on every file which is created in the current shell?