Get Update on recent Technology & Programming

Sunday, 29 October 2017

Shell Script Arithmetic Operations

Posted by   on Pinterest

Shell Script Arithmetic Operations


 echo "Enter first number :-"  
 read num1  
 echo "Enter second number :-"  
 read num2  
 ans=`expr $num1 + $num2`  
 echo "Addition is : $ans"  
 ans=`expr $num1 - $num2`  
 echo "Substraction is : $ans"  
 ans=`expr $num1 \* $num2`  
 echo "Multiplication is : $ans"  
 ans=`expr $num1 / $num2`  
 echo "Division is : $ans"  
 ans=`expr $num1 % $num2`  
 echo "Modulus is : $ans"  

No comments:
Write comments

Hey, we've just launched a new custom color Blogger template. You'll like it -
Join Our Newsletter