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


Please Help Members By Posting Answers For Below Questions

What is awk in shell scripting?

559


What's the difference between scripting and coding?

599


Explain about gui scripting?

626


How to get script name inside a script?

556


Is bash a shell script?

607






What are the different communication commands available in the shell?

521


What is web script?

586


one folder contains lot of students name but I want to fetch hello with every student name individually using shell script

522


What is the best shell scripting language?

543


Give some situations where typing error can destroy a program?

729


How do I run a shell script in powershell?

556


What is the default ubuntu terminal?

624


How many fields are present in a crontab file and what does each field specify?

590


What is shell and shell script?

558


Please give me example of " at command , contrab command " how to use

2331