write a shell script for addition, subtraction, multiplication and division of two numbers

Posted By on September 14, 2014


Download PDF
write a shell script for addition of three integer numbers.
find whether the entered number is prime or not.

Script: –

echo “Enter a:” read a

eho “Enter b:” read b

sum= `expr $a + $b`

diff= `expr $a – $b`

prod= `expr $a * $b`

quo= `expr $a / $b`

echo $sum echo $diff echo $prod echo $quo

Output: –

Enter a: 6

Enter b: 3

9 3 18 2

write a shell script for addition of three integer numbers.
find whether the entered number is prime or not.

Download PDF

Posted by Akash Kurup

Founder and C.E.O, World4Engineers Educationist and Entrepreneur by passion. Orator and blogger by hobby

Website: http://world4engineers.com