answersLogoWhite

0

echo "Program to check even or odd number"

echo "Enter a number"

read n

a=`expr $n % 2`

if [ $a -eq 0 ] ; then #Semicolon is most important for Executing ifelse statements

echo "It is an even number"

else

echo "It is an odd number"

fi

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Write a shell programs for to check whether the given number is an Avogadro number or not?

Avogadro's number is a constant. Therefore only one number is equal to Avogadro's number.


The total number of electrons inan electron shell is reepresented by the formula 2n . is this correc?

The maximum number of electrons in a shell / energy level is given by 2n2.


Write a shell script to check whether the given input is prime or not?

shell script for check whether the given no is prime or not??echo "input any number:"read nono=`expr $no`i=`expr 2`while [ $i -lt $no ]doif [ `expr $no % $i` -eq 0];thenecho "$no is not a prime no.."break 2fii=`expr $i +1`doneif [ $i -eq $no ];thenecho "$no is a PRIME no..."fi


Whynot you use any onther programming except shell programming?

Shell programming can get you only so far; after that you need to use another programming language (possibly even another scripting language) to get the job done. Shell programming is designed to work with the system interface and to help automate tasks; it isn't good for everything.


Shell program to find the smallest digit of a given number?

syntax error


How many electrons are in the first ten shells of an atom?

The number of electrons in any given shell can be represented by 2n2, where n = the shell number. The first shell has 2, second has 8, third has 18...


What is the difference between the Linux shell and C?

C is a programming language. A shell is an interface.


What are the types of shells in shell programming?

The Bourne shell (sh) ,The C shell (csh) ,The Korn shell (ksh) ,The Z-Shell (zsh) ,The POSIX shell,The Bourne Again SHell (Bash)null


Does the number of electrons in the innermost shell of an atom determine whether the atom has high or low reactivity?

Only in hydrogen or helium, because in these two elements only the innermost shell is also the outermost shell.


What is the importance of Linux shell?

Linux shell is a programming language. its fully different from others progrmming language. the script which is used in Linux quite tough to remember if we comparison to other programming laguages.


All of the orbitals in a given electron shell have the same value of the?

The same value of the principal quantum number.


Sum of n numbers in shell programming?

2 4 6