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
How to debug the problems encountered in the shell script/program?
What is an sh file?
Explain about login shell?
Determine the output of the following command: name=shubham && echo ‘my name is $name’.
Explain how you Automate your application using Shell scripting.
What is web script?
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
Which is better perl or shell scripting?
What are scripts in psychology?
What is shell variable?
Explain about echo command?
how will you find the total disk space used by a specific user?
What is basename in shell script?
How to print pid of the current shell?
Is powershell a bash?