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
Why do we use shell scripting?
What's the difference between scripting and coding?
What is option in shell script?
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script
Where is bash history?
Can you write a script to portray how set –x works?
Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.
State the advantages of shell scripting?
How does shell scripting work?
Suppose you execute a command using exec, what will be the status of your current process in the shell?
I have 2 files and I want to print the records which are common to both.
What is the first line in every perl script called?
What is the conditional statement in shell scripting?
How does ls command work?
What is c in shell script?