Write a shell program to test whether a given number is even
or odd?
Answer Posted / mani
echo "Enter the Number"
read a
b=`echo "$a % 2"|bc`
if [ $b -eq 0 ]
then
echo "Given Number is Even "
exit
fi
echo " Given Number is odd"
Is This Answer Correct ? | 67 Yes | 34 No |
Post New Answer View All Answers
how to get part of string variable with echo command only?
What is the best scripting language?
What is a shell script in windows?
How can we find the process name from its process id?
What is shell scripting?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
How to get the first line from a file using just the terminal?
Explain about stdin, stdout and stderr?
What is an inode block?
How do I run a script on mac?
Calculate a real number calculation directly from the terminal and not any shell script.
What is sh in shell script?
Why is used in shell scripting?
Is shell scripting difficult?
What are scripts in psychology?