Write a shell program to test whether a given number is even
or odd?
Answer Posted / karishma
echo -n "Enter numnber : "
set number = $<
set rem=expr( $number % 2 )
if($rem -eq 0)
then
echo "$number is even number"
else
echo "$number is odd number"
endif
Is This Answer Correct ? | 19 Yes | 19 No |
Post New Answer View All Answers
Which is better perl or shell scripting?
What is the conditional statement in shell scripting?
What is shell scripting?
Which shell is the best?
How do I save a powershell script?
What is batch file programming?
How will you emulate wc –l using awk?
What is the lifespan of a variable inside a shell script?
How are shells born?
Explain about return code?
What is the difference between grep and egrep?
What is the best shell scripting language?
How to pass an argument to a script?
What is awk in shell script?
How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?