Write a Shell Script to Swap Numbers (Using Temporary Variable)?

Code:

numberone=5
numbertwo=10
echo "Before swapping"
echo "Enter First Number: " $numberone
echo "Enter Second Number: " $numbertwo
tempvar=$numberone
numberone=$numbertwo
numbertwo=$tempvar
echo "Number After Swapping"
echo "Value of First number: " $ numberOne

echo "Value of Second number: " $ numbertwo

Post a Comment

0 Comments