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 can scripts do?
What does debug script mean?
Is cmd a shell?
What is shift command in shell script?
What is @echo off?
How will you copy a file from one machine to other?
Write a command sequence to find the count of each word?
What is bash shell command?
What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?
What are "c" and "b" permission fields of a file?
What is computer cli?
What is meant by dos operating system?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
Is shell scripting a language?