Write a shell program to test whether a given number is even
or odd?
Answer Posted / fariha
echo -n "Enter numnber : "
read n
rem=$(( $n % 2 ))
if [ $rem -eq 0 ]
then
echo "$n is even number"
else
echo "$n is odd number"
fi
| Is This Answer Correct ? | 240 Yes | 73 No |
Post New Answer View All Answers
Is scripting and coding the same thing?
How to use arguments in a script?
Is bash an operating system?
What is a shell script in windows?
What are the 3 standard streams in linux?
Why do we use shell scripting?
What is shell variable?
How can you find out how long the system has been running?
What is a file basename?
What is k shell?
What is the crontab?
What is computer cli?
How to get the first line from a file using just the terminal?
How to pass an argument to a script?
What is another name for a bash shell script that you might see?