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
How do I run a powershell script?
Why are there shells on the beach?
What language is shell scripting?
What exactly is a shell?
How will you copy a file from one machine to other?
What can you do with powershell?
Write a command sequence to find the count of each word?
is this growing field and what is average package in this?
What is the default shell of solaris?
How do I open the shell in cmd?
What is the significance of the shebang line in shell scripting?
What is computer cli?
Explore about environment variables?
c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command
What is scripting used for?