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
How to get script name inside a script?
How to print all array elements and their respective indexes?
What is .sh file in mac?
What language is shell scripting?
How do I run a powershell script?
How does ls command work?
How to check if the previous command was run successfully?
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
What command needs to be used to take the backup?
What does egrep mean?
Is powershell a language?
shell script for reverse the string
Write a script to print the first 10 elements of fibonacci series.
What is an inode block?
What is shell geeksforgeeks?