Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a shell program to test whether a given number is even
or odd?

Answer Posted / fariha

echo -n "Enter numnber : "
read n

rem=$(( $n % 2 ))

if [ $rem -eq 0 ]
then
echo "$n is even number"
else
echo "$n is odd number"
fi

Is This Answer Correct ?    240 Yes 73 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the meaning of $1 in shell script?

1114


Explain about debugging?

1016


What is a boot block?

1021


How to debug the problems encountered in the shell script/program?

1141


What are zombie processes?

1024


How can you get the value of pi till a 100 decimal places?

967


Why is it called a shell?

925


What are different types of shell?

923


Explain about sourcing commands?

1088


What is shift command in shell script?

1031


What is the first line of a shell script called?

1081


How will you find the 99th line of a file using only tail and head command?

2531


What is shell scripting?

1048


How do I open a jshell in cmd?

1238


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2470