Shell program - swapping of two numbers using third variable

CODE:

#! /bin/bash

echo "enter two numbers:"
read a
read b
echo "Before swapping, a=$a and b=$b"
z=$a
a=$b
b=$z

echo "After swapping, a=$a and b=$b"

OUTPUT:
Shell program - swapping of two numbers using third variable

No comments :

Post a Comment