Write a shell program to test whether a given number is even
or odd?
Answer Posted / karishma
echo -n "Enter numnber : "
set number = $<
set rem=expr( $number % 2 )
if($rem -eq 0)
then
echo "$number is even number"
else
echo "$number is odd number"
endif
Is This Answer Correct ? | 19 Yes | 19 No |
Post New Answer View All Answers
What is c in shell script?
How to write a function?
What is web script?
What is echo $shell?
Explain about the slow execution speed of shells?
What is awk in shell scripting?
What are the different commands available to check the disk usage?
How can I send a mail with a compressed file as an attachment?
What does sh mean?
How to get the first line from a file using just the terminal?
What is the first line in every perl script called?
What is the difference between scripting and coding?
Write the syntax for "if" conditionals in linux?
What is the difference between grep and egrep?
How to print all array elements and their respective indexes?