Write a shell program to test whether a given number is even
or odd?
Answer Posted / rk
echo"enter number"
read n
set r=($n%2)
if(r eq-0)
then
echo "even number:$n"
else
echo "odd number:$n"
fi
| Is This Answer Correct ? | 24 Yes | 16 No |
Post New Answer View All Answers
What is path in shell script?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
How do I run a shell script in powershell?
What is @echo off?
What is the way to do multilevel if-else's in shell scripting?
What does $0 mean in shell script?
What's the difference between scripting and coding?
How to get the 3rd element/column from each line from a file?
What is shell prompt?
What is awk in shell script?
What are the default permissions of a file when it is created?
How do I open the shell prompt?
How do I run a shell script on a mac?
How to get the last line from a file using just the terminal?
What is a file basename?